on 04-09-2008 8:14 AM
hi ,
i have to develop bdc for upload the data to VA01 and VA02 Transactions,
i developed a code but here i am not able to call VA01 t.code after VA02.
here my requirement is 1 st have to run VA02 Based onthat i have to create SUBSEQUENT ORDRE TYPES .
here i am pasting my logic
please give me solution.
LOOP AT RECORD.
if sy-subrc <> 0. exit. endif.
perform bdc_dynpro using 'SAPMV45A' '0102'.
perform bdc_field using 'BDC_CURSOR'
'VBAK-VBELN'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VBAK-VBELN'
'5710000102'.
record-vbeln.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'/EFAU1'.
perform bdc_field using 'VBKD-BSTKD'
'23'.
record-bstkd.
perform bdc_field using 'VBKD-BSTDK'
'04.04.2008'.
record-bstdk.
perform bdc_field using 'KUAGV-KUNNR'
'2600000016'.
record-kunnr.
perform bdc_field using 'KUWEV-KUNNR'
'2600000016'.
record-KUNNR1.
perform bdc_field using 'RV45A-KETDAT'
'08.01.2008'.
record-ketdat.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
record-kprgbz.
perform bdc_field using 'BDC_CURSOR'
'VBAP-POSNR(01)'.
perform bdc_field using 'RV45A-VBAP_SELKZ(01)'
'X'.
perform bdc_transaction using 'VA02'.
perform bdc_dynpro using 'SAPMV45A' '0101'.
perform bdc_field using 'BDC_CURSOR'
'VBAK-AUART'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VBAK-AUART'
'zdps'.
record-auart.
perform bdc_field using 'VBAK-VKORG'
'IN01'.
record-vkorg.
perform bdc_field using 'VBAK-VTWEG'
'AI'.
record-vtweg.
perform bdc_field using 'VBAK-SPART'
'LF'.
record-spart.
perform bdc_dynpro using 'SAPLV45C' '0100'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'LV45C-VBELN'.
perform bdc_field using 'LV45C-VBELN'
'5710000102'.
record-vbeln.
perform bdc_dynpro using 'SAPLV45C' '0100'.
perform bdc_field using 'BDC_OKCODE'
'=UEBR'.
perform bdc_field using 'BDC_CURSOR'
'LV45C-VBELN'.
perform bdc_field using 'LV45C-VBELN'
'5710000102'.
record-vbeln.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-BSTDK'.
perform bdc_field using 'VBKD-BSTKD'
'23'.
record-bstkd.
perform bdc_field using 'VBKD-BSTDK'
'04.04.2008'.
record-bstdk.
perform bdc_field using 'KUAGV-KUNNR'
'2600000016'.
record-KUNNR.
perform bdc_field using 'KUWEV-KUNNR'
'2600000016'.
record-KUNNR1.
perform bdc_field using 'RV45A-KETDAT'
'08.01.2008'.
record-ketdat.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
record-kprgbz.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
perform bdc_field using 'VBKD-BSTKD'
'23'.
record-bstkd.
perform bdc_field using 'VBKD-BSTDK'
'04.04.2008'.
record-bstdk.
perform bdc_field using 'KUAGV-KUNNR'
'2600000016'.
record-KUNNR.
perform bdc_field using 'KUWEV-KUNNR'
'2600000016'.
record-KUNNR1.
perform bdc_field using 'RV45A-KETDAT'
'08.01.2008'.
record-ketdat.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
record-kprgbz.
perform bdc_field using 'BDC_CURSOR'
'RV45A-MABNR(02)'.
perform bdc_transaction using 'VA01'.
*CLEAR RECORD.
ENDLOOP.
*perform close_group.
&----
*& Form bdc_dynpro
&----
text
----
-->P_0231 text
-->P_0232 text
----
FORM BDC_DYNPRO USING p_gv_program LIKE bdcdata-program
p_gv_dynpro LIKE bdcdata-dynpro.
CLEAR gt_bdcdata.
gt_bdcdata-program = p_gv_program.
gt_bdcdata-dynpro = p_gv_dynpro.
gt_bdcdata-dynbegin = 'X'.
APPEND gt_bdcdata.
ENDFORM. "BDC_DYNPRO
&----
*& Form bdc_field
&----
text
----
-->P_0236 text
-->P_0237 text
----
FORM bdc_field USING p_gv_fnam
p_gv_fval.
CLEAR gt_bdcdata.
gt_bdcdata-fnam = p_gv_fnam.
gt_bdcdata-fval = p_gv_fval.
APPEND gt_bdcdata.
ENDFORM. "BDC_FIELD
&----
*& Form bdc_transaction
&----
text
----
-->P_0301 text
----
FORM bdc_transaction USING VALUE(P_0301).
CALL TRANSACTION 'VA02' USING gt_bdcdata MODE 'A' UPDATE 'S'.
IF SY-SUBRC = 0.
CALL TRANSACTION 'VA01' USING gt_bdcdata MODE 'A' UPDATE 'S'.
ENDIF.
ENDFORM. " bdc_transaction
hi santhosh,
do like this...
1) your program should execute for VA02 using call transaction i.e. if sales order exists go for change mode if not go to VA01 using session method.
2) You can update the both transactions in Session method but not both in call transactions....
All the best ... Feel free to contact if still need any clarification....
Reward Points.....
Regards,
Sreenivasa Sarma K.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
The CALL TRANSACTION method allows only a single transaction to be processed by SAP.
BDC-INSERT function allow multiple transactions to be processed by SAP.
reward points if useful
regards
sandhya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
1.In call transaction,working with multiple transactions is not possible.
2.Suppose you are updating VA02 first , after that you are creating through VA01.
3.On which based the VA01 can trigger.please check once.
Regards,
If helpful reward with points(Don't forget).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.