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

upload

Former Member
0 Likes
737

will this code work fine.

actuall '1' is a header and '2' is a line item record and may be sometimes there are multiple '2' type records in the flat which is uploaded into t_data and updating a table . that is done in perform upload. will this code upload '2' type records if there r multiple records?

LOOP AT T_DATA.

IF T_DATA-FLD+1(1) = '1'

or T_DATA-FLD+1(1) = '2'.

PERFORM UPLOAD.

endif.

regards,

siri.

1 ACCEPTED SOLUTION
Read only

former_member404244
Active Contributor
0 Likes
722

Hi,

It should work fine as u r looping the internal table.

Regards,

Nagaraj

7 REPLIES 7
Read only

Former Member
0 Likes
722

will this not work?

regards,

siri.

Read only

former_member404244
Active Contributor
0 Likes
723

Hi,

It should work fine as u r looping the internal table.

Regards,

Nagaraj

Read only

Former Member
0 Likes
722

Hi Sireesha,

if T_DATA-FLD+1(1) can be either 1 or 2 ONLY,

The peice of code that you have written.. will upload every record.. ie perform upload will be executed always.

Regards,

Sameer

Read only

Former Member
0 Likes
722

Hi,

Whenever the data-fld1(1) value is 2 it will upload the records no matter how many times they appear but (data-fld1(1) = 2) must be satisfied.

I think the code should work.

Thanks,

Sandeep.

Read only

0 Likes
722

Thanks all.

record type '1' is always present since it is a header and '2' is also present sometimes single and sometimes multiple .

if multiple then will my code work?

regards,

siri.

Read only

Former Member
0 Likes
722

Hi Sireesha,

I think it will. (meaning the "If" will always be true.)

Regards,

Sameer

Read only

Former Member
0 Likes
722

Hi ...

see the example code of myin in the table control BDC ...here it is there Header and Line item ....

LOOP AT IT_DUMMY.
  IF IT_DUMMY-DUMMY+0(2) = '11'.
    IT_XK01-LIFNR = IT_DUMMY-DUMMY+2(10).
    IT_XK01-BUKRS = IT_DUMMY-DUMMY+12(4).
    IT_XK01-EKORG = IT_DUMMY-DUMMY+16(4).
    IT_XK01-KTOKK = IT_DUMMY-DUMMY+20(4).
    IT_XK01-NAME1 = IT_DUMMY-DUMMY+24(30).
    IT_XK01-SORTL = IT_DUMMY-DUMMY+54(10).
    IT_XK01-LAND1 = IT_DUMMY-DUMMY+64(3).
    IT_XK01-SPRAS = IT_DUMMY-DUMMY+67(2).
    IT_XK01-AKONT = IT_DUMMY-DUMMY+69(6).
    IT_XK01-FDGRV = IT_DUMMY-DUMMY+75(2).
    IT_XK01-WAERS = IT_DUMMY-DUMMY+77(3).
    APPEND IT_XK01.
  ELSE.
    IT_BANK-BANKS = IT_DUMMY-DUMMY+2(3).
    IT_BANK-BANKL = IT_DUMMY-DUMMY+5(10).
    IT_BANK-BANKN = IT_DUMMY-DUMMY+15(10).
    IT_BANK-KOINH = IT_DUMMY-DUMMY+25(30).
    IT_BANK-LIFNR = IT_DUMMY-DUMMY+55(10).
    APPEND IT_BANK.
  ENDIF.
ENDLOOP.

reward points if it is usefull..

Girish