‎2008 Jun 06 6:40 PM
hi guys,
iam doing BDC,but iam stuck in one point please suggest me how to proceed further.
in table control of bdc i have three records.
i have to check an particulat field like WA_ITAB_COBRB_NEW-LETJA is not empty then i need to do BDC for that particular row.
now the same check for the second row and if any data exits in that field i need to skip that particular row for recording that means i need to increment tmpnum = tmpnum+1.
iam doing bdc for ko02 t.code.
and for planned settlement version copy from 01 to 02 and so.
the below is my code.
but i think it is not accurate please suggest me .
thanks in advance.
LOOP AT ITAB_TEMP_VERSN2
WHERE OBJNR = TMPOBJNR AND VERSN = XVERSN1.
CLEAR: FLAG.
tmpnum = sy-tabix .
case: tmpnum.
when '1'.
READ TABLE ITAB_COBRB_NEW INTO WA_ITAB_COBRB_NEW with key urzuo = '097'.
if sy-subrc eq 0 and WA_ITAB_COBRB_NEW-LETJA <> '0000'.
FLAG = 'Y'.
endif.
when '2'.
READ TABLE ITAB_COBRB_NEW INTO WA_ITAB_COBRB_NEW with key urzuo = '095'.
if sy-subrc eq 0 and WA_ITAB_COBRB_NEW-LETJA <> '0000'.
FLAG = 'Y'.
endif.
when '3'.
READ TABLE ITAB_COBRB_NEW INTO WA_ITAB_COBRB_NEW with key urzuo = '094'.
if sy-subrc eq 0 and WA_ITAB_COBRB_NEW-LETJA <> '0000'.
FLAG = 'Y'.
endif.
endcase.
IF FLAG = 'Y'.
TMPFIELDNUM = TMPFIELDNUM + 1.
ELSE.
TMPFIELDNUM = TMPFIELDNUM + 1.
CLEAR: TMPBDCFIELD.
CONCATENATE 'DKOBR-EMPGE(' TMPFIELDNUM ')' INTO TMPBDCFIELD.
PERFORM BDC_FIELD USING TMPBDCFIELD ITAB_TEMP_VERSN2-KOSTL.
endif.
thnaks in advance and waiting for solution.
‎2008 Jun 06 9:16 PM
Hi Aruna kumar,
You can very well handle the table controls in BDC session method using line index ,
Line index indicates which line of Table control is to be use for BDC transaction,
Ex -
perform bdc_field using 'RC29K-AUSKZ(01)'
indicates 1st line of table control is going to be used for transaction which is Line index of Table Control
Reward points if useful.
Regards,
Sekhar
‎2008 Jun 07 5:50 AM
Hello Aruna,
Even your logic is a little funny, everything seems to be fine except the counting of the field TMPFIELDNUM.
Your block
IF FLAG = 'Y'.
TMPFIELDNUM = TMPFIELDNUM + 1.
ELSE.
TMPFIELDNUM = TMPFIELDNUM + 1.
CLEAR: TMPBDCFIELD.
CONCATENATE 'DKOBR-EMPGE(' TMPFIELDNUM ')' INTO TMPBDCFIELD.
PERFORM BDC_FIELD USING TMPBDCFIELD ITAB_TEMP_VERSN2-KOSTL.
endif.Should be replaced by
IF FLAG is initial..
TMPFIELDNUM = TMPFIELDNUM + 1.
CLEAR: TMPBDCFIELD.
CONCATENATE 'DKOBR-EMPGE(' TMPFIELDNUM ')' INTO TMPBDCFIELD.
PERFORM BDC_FIELD USING TMPBDCFIELD ITAB_TEMP_VERSN2-KOSTL.
endif.The statement if sy-subrc eq 0 and WA_ITAB_COBRB_NEW-LETJA '0000'. will cause a syntax error (= '0000').
Is the second parameter of the PERFORM also a table field? If YES, then there has to be an index appended as well.
Have success,
Heinz
‎2008 Jun 10 5:49 PM