‎2007 Jun 19 11:36 AM
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.
‎2007 Jun 19 11:57 AM
Hi,
It should work fine as u r looping the internal table.
Regards,
Nagaraj
‎2007 Jun 19 11:51 AM
‎2007 Jun 19 11:57 AM
Hi,
It should work fine as u r looping the internal table.
Regards,
Nagaraj
‎2007 Jun 19 11:58 AM
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
‎2007 Jun 19 11:58 AM
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.
‎2007 Jun 19 12:04 PM
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.
‎2007 Jun 19 12:07 PM
Hi Sireesha,
I think it will. (meaning the "If" will always be true.)
Regards,
Sameer
‎2007 Jun 19 12:13 PM
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