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

sy-subrc

Former Member
0 Likes
733

Hi,

i do loop on Fm and i have to get table with data,

but after the loop the table is empty end i still get sy-ubrc = 0

what i have to ask instead ?

Regards

1 ACCEPTED SOLUTION
Read only

Sm1tje
Active Contributor
0 Likes
705

If your sy-subrc AFTER the loop = 0, this only means that looping over internal table was successfull. This doesn't say anything about your FM.

Maybe you can post a code extract, and we can see what is the exact problem.

5 REPLIES 5
Read only

Sm1tje
Active Contributor
0 Likes
706

If your sy-subrc AFTER the loop = 0, this only means that looping over internal table was successfull. This doesn't say anything about your FM.

Maybe you can post a code extract, and we can see what is the exact problem.

Read only

Former Member
0 Likes
705

HI,

can you please paste that piece of code here ????

Read only

Former Member
0 Likes
705

hi,

this is the code i dont wont to do append if table is empty,

Regards

LOOP AT it_eme ASSIGNING <_emp>.

CALL FUNCTION 'Z_Logig'

EXPORTING

employee_number = <emp>-pernr

TABLES

data1 = data1

data2 = data2

data3 = data3.

APPEND LINES OF : data1 TO it_1,

data2 TO it_2,

data3 TO it_3.

ENDLOOP.

Read only

0 Likes
705

hi,

do this way ..

LOOP AT it_eme ASSIGNING <_emp>.

CALL FUNCTION 'Z_Logig'

EXPORTING

employee_number = <emp>-pernr

TABLES

data1 = data1

data2 = data2

data3 = data3.

if not data1[] is initial.

APPEND LINES OF : data1 TO it_1.

endif.

if not data2[] is initial.

APPEND LINES OF : data2 TO it_2.

endif.

if not data3[] is initial.

APPEND LINES OF : data3 TO it_3.

endif.

ENDLOOP.

Read only

0 Likes
705

Arona,

nothing to add anymore to code of Santosh. Looks pretty much the same as my suggestion.