2007 May 14 7:51 AM
hi friends,
while executing call transaction i am not able to see the transaction calling. data is get populated in to internal table but transaction is not get called. see the code
FORM BDC_POPULATE.
REFRESH BDC_DATA.
LOOP AT W_ITAB.
perform bdc_dynpro using 'SAPLSPO4' '0300'.
perform bdc_field using 'BDC_CURSOR'
'SVALD-VALUE(01)'.
perform bdc_field using 'BDC_OKCODE'
'=FURT'.
perform bdc_field using 'SVALD-VALUE(01)'
'g2p'.
perform bdc_dynpro using 'SAPMKBUD' '0200'.
perform bdc_field using 'BDC_CURSOR'
'PRPS-POSID'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'PRPS-POSID'
w_itab-p_pspnr.
perform bdc_field using 'BPDY-VERSN'
'0'.
perform bdc_dynpro using 'SAPLKBPP' '0320'.
perform bdc_field using 'BDC_CURSOR'
w_itab-p_wert1.
perform bdc_field using 'BDC_OKCODE'
'=SAVE'.
*perform bdc_field using 'BPDY-WERT1(01)'
w_itab-p_wert1.
*perform bdc_transaction using 'CJ40'.
CALL TRANSACTION 'CJ40' USING BDC_DATA MODE 'A' UPDATE 'S' MESSAGES
INTO BDC_MSGCOLL.
IF SY-SUBRC <> 0.
WRITE:/' messgae'.
ENDIF.
endloop.
endform.
here data is populated into internal table but not getting into transaction pls suggest me.
kumar.
hi friends,
while executing call transaction i am not able to see the transaction calling. data is get populated in to internal table but transaction is not get called. see the code
FORM BDC_POPULATE.
REFRESH BDC_DATA.
LOOP AT W_ITAB.
perform bdc_dynpro using 'SAPLSPO4' '0300'.
perform bdc_field using 'BDC_CURSOR'
'SVALD-VALUE(01)'.
perform bdc_field using 'BDC_OKCODE'
'=FURT'.
perform bdc_field using 'SVALD-VALUE(01)'
'g2p'.
perform bdc_dynpro using 'SAPMKBUD' '0200'.
perform bdc_field using 'BDC_CURSOR'
'PRPS-POSID'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'PRPS-POSID'
w_itab-p_pspnr.
perform bdc_field using 'BPDY-VERSN'
'0'.
perform bdc_dynpro using 'SAPLKBPP' '0320'.
perform bdc_field using 'BDC_CURSOR'
w_itab-p_wert1.
perform bdc_field using 'BDC_OKCODE'
'=SAVE'.
*perform bdc_field using 'BPDY-WERT1(01)'
w_itab-p_wert1.
*perform bdc_transaction using 'CJ40'.
CALL TRANSACTION 'CJ40' USING BDC_DATA MODE 'A' UPDATE 'S' MESSAGES
INTO BDC_MSGCOLL.
IF SY-SUBRC <> 0.
WRITE:/' messgae'.
ENDIF.
endloop.
endform.
here data is populated into internal table but not getting into transaction pls suggest me.
kumar.
2007 May 14 7:54 AM
2007 May 14 8:03 AM
hi,
Put a break point where the data in the BDCDATA internal table is getting appended..
If data is getting appended properly in the internal table for sure the Transaction will get the proper data populated..
Try once again recording the transaction and see whether you are correctly passing the data and structure of internal table is also correct. ..
rewards if useful
regards,
nazeer
2007 May 14 8:14 AM
Hi Kumar,
U r using standard perform bdc_dynpro and bdc_field.
therefore u have to include this :
<b>include bdcrecx1.</b>
If u don't want to do this . build ur own perform .Refer this code :
FORM BDC_POPULATE.
REFRESH BDC_DATA.
LOOP AT W_ITAB.
perform bdc_dynpro1 using 'SAPLSPO4' '0300'.
perform bdc_field1 using 'BDC_CURSOR'
'SVALD-VALUE(01)'.
perform bdc_field1 using 'BDC_OKCODE'
'=FURT'.
perform bdc_field1 using 'SVALD-VALUE(01)'
'g2p'.
perform bdc_dynpro1 using 'SAPMKBUD' '0200'.
perform bdc_field1 using 'BDC_CURSOR'
'PRPS-POSID'.
perform bdc_field1 using 'BDC_OKCODE'
'/00'.
perform bdc_field1 using 'PRPS-POSID'
w_itab-p_pspnr.
perform bdc_field1 using 'BPDY-VERSN'
'0'.
perform bdc_dynpro using 'SAPLKBPP' '0320'.
perform bdc_field1 using 'BDC_CURSOR'
w_itab-p_wert1.
perform bdc_field1 using 'BDC_OKCODE'
'=SAVE'.
perform bdc_field1 using 'BPDY-WERT1(01)'
w_itab-p_wert1.
perform bdc_transaction1 using 'CJ40'.
endloop.
endform.
&----
*& Form bdc_dynpro1
&----
text
----
-->P_0227 text
-->P_0228 text
----
FORM bdc_dynpro1 USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM. " bdc_dynpro1
&----
*& Form bdc_field1
&----
text
----
-->P_0232 text
-->P_0233 text
----
FORM bdc_field1 USING FNAM FVAL.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDFORM. " bdc_field1
&----
*& Form bdc_transaction1
&----
text
----
-->P_0372 text
----
FORM bdc_transaction1 USING TCODE.
CALL TRANSACTION TCODE USING BDCDATA MODE 'A' UPDATE 'S'.
ENDFORM. " bdc_transaction1
Reward points if helpful.
Regards,
Hemant