Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

refresh itab is not getting triggered

Former Member
0 Likes
809

hi,

SELECT ebeln

bukrs

ernam

lifnr

spras

FROM ekko INTO CORRESPONDING FIELDS OF

TABLE g_it_ekko WHERE lifnr IN r_lifnr.

DESCRIBE TABLE g_it_ekko LINES n.

grid-lines = n.

IF sy-subrc = 0.

MESSAGE s002(zsan) WITH n.

ELSE.

REFRESH g_it_ekko.

MESSAGE e000(zsan) WITH n.

ENDIF.

the message is gettig triggered first but the refresh statement is not getting triggered. i want the refresh statement should be triggered first and then the message.plz help.

thanks & regards,

santosh.

1 ACCEPTED SOLUTION
Read only

i048168
Product and Topic Expert
Product and Topic Expert
0 Likes
785

Hi,

Here the refresh statement is executed at first before the message statement executes.

Since the message is of error type, it stops here.

Regards

Vadi

hi,

SELECT ebeln

bukrs

ernam

lifnr

spras

FROM ekko INTO CORRESPONDING FIELDS OF

TABLE g_it_ekko WHERE lifnr IN r_lifnr.

DESCRIBE TABLE g_it_ekko LINES n.

grid-lines = n.

IF sy-subrc = 0.

MESSAGE s002(zsan) WITH n.

ELSE.

REFRESH g_it_ekko.

MESSAGE e000(zsan) WITH n.

ENDIF.

the message is gettig triggered first but the refresh statement is not getting triggered. i want the refresh statement should be triggered first and then the message.plz help.

thanks & regards,

santosh.

6 REPLIES 6
Read only

Former Member
0 Likes
785

Hello Santhosh,

Problem is with error message. Note that error message will stop the further execution of the program. So, your refresh statement won't work here. just write the refresh statement in front of the error message. It will work.

Reward If Helpful.

Regards

--

Sasidhar Reddy Matli.

Read only

Former Member
0 Likes
785

then remove the refresh statement from the if condition and then place before the if condition, becaue if the records are fetched then the message displays if not fetched then it refreshes the internal table and then it pops up the message.

Read only

Former Member
0 Likes
785

Hi Santosh,

Refer the code below.

IF sy-subrc = 0.

MESSAGE s002(zsan) WITH n.

ELSE.

Clear g_it_ekko

REFRESH g_it_ekko[].

MESSAGE e000(zsan) WITH n.

ENDIF.

Hope this helps.

Manish

Read only

Former Member
0 Likes
785

Hi Santosh,

Put a break-point in else statement and check in debug whether the control is going to that statement.

There is no issue with your refresh statement.

Regards,

Gaurav.

Read only

Former Member
0 Likes
785

Try changing ur code like below

SELECT ebeln
bukrs
ernam
lifnr
spras
FROM ekko INTO CORRESPONDING FIELDS OF
TABLE g_it_ekko WHERE lifnr IN r_lifnr.

IF sy-subrc = 0.
DESCRIBE TABLE g_it_ekko LINES n.
grid-lines = n.
MESSAGE s002(zsan) WITH n.
ELSE.
REFRESH g_it_ekko.
DESCRIBE TABLE g_it_ekko LINES n.
grid-lines = n.
MESSAGE w000(zsan) WITH n.           "warning msg
ENDIF.

Read only

i048168
Product and Topic Expert
Product and Topic Expert
0 Likes
786

Hi,

Here the refresh statement is executed at first before the message statement executes.

Since the message is of error type, it stops here.

Regards

Vadi