03-30-2016 10:24 AM
By using BAPI_OUTB_DELIVERY_CHANGE updating the data in delivery header level by using extension method process after completing FM using BAPI_Transaction_Commit as well ,when i am trying to execute in debug mode data updating but in normal process (through IDOC we19) not updating
could you please some one help me on this.
Best Regards,
Raghava
03-30-2016 10:47 AM
Did you check your implementation of BAdI SMOD_V50B0001: Look for problem solved by implicit db commit or delay during debug execution.
Question: IDoc SHP_OBDLV_CHANGE01?
Regards,
Raymond
03-30-2016 10:47 AM
Did you check your implementation of BAdI SMOD_V50B0001: Look for problem solved by implicit db commit or delay during debug execution.
Question: IDoc SHP_OBDLV_CHANGE01?
Regards,
Raymond
03-30-2016 11:22 AM
Hi Raymond,
I have checked BAdi IF_EX_SMOD_V50B0001~EXIT_SAPLV50I_010
after using commit work and wait also its not updating.
best Regards,
Raghava
03-30-2016 12:53 PM
03-30-2016 1:30 PM
Hi Raymond,
In BADi only .
Still not updating values in normal process .
Best Regards,
Raghava
03-30-2016 2:13 PM
I don't think you are allowed to commit at this step, seems you may break the "transaction" (precocious commit, unlock of record, etc.)
You should only change CS_VBKOK, CT_VBPOK and CT_VBSUPCON from data of EXTENSION1 and-2. Let the system do the commit.
Regards;
Raymond
03-30-2016 2:25 PM
Hi Raymond,
I am updating CS_VBKOK table by using EXTENSION1 and-2.
but still i am facing same issue .
In debug mode values updating fine with same code but not in normal process .
Best Regards,
Raghava
03-30-2016 2:29 PM
03-30-2016 2:39 PM
03-30-2016 3:33 PM
03-30-2016 3:46 PM
IDOC FM : Z_IDOC_INPUT_DELVRY
Perform update_eta_data
From update_eta_data
IF s_dl20-vbeln IS NOT INITIAL.
ls_header-deliv_numb = s_dl20-vbeln.
ls_header_control-deliv_numb = s_dl20-vbeln.
ls_ext1-field1 = 'ZZETADATE'.
ls_ext1-field2 = 'ZZETATIME'.
ls_ext1-field3 = 'ZZETARC'.
ls_ext1-field4 = 'ZZETARCD'.
APPEND ls_ext1 TO lt_ext1.
CLEAR ls_ext1.
IF s_zdl20-etadate IS NOT INITIAL .
ls_ext2-param = 'LIKP'.
ls_ext2-row = '1'.
ls_ext2-field = 'ZZETADATE'. "Z FIELD 2
ls_ext2-value = s_zdl20-etadate.
ls_ext2-type = 'DATS'.
ls_ext2-length = '8'.
APPEND ls_ext2 TO lt_ext2.
CLEAR : ls_ext2.
ENDIF.
IF s_zdl20-etatime IS NOT INITIAL.
ls_ext2-param = 'LIKP'.
ls_ext2-row = '1'.
ls_ext2-field = 'ZZETATIME'. "Z FIELD 2
ls_ext2-value = s_zdl20-etatime.
ls_ext2-type = 'TIMS'.
ls_ext2-length = '6'.
APPEND ls_ext2 TO lt_ext2.
CLEAR : ls_ext2.
ENDIF.
IF s_zdl20-zzetarc IS NOT INITIAL.
ls_ext2-param = 'LIKP'.
ls_ext2-row = '1'.
ls_ext2-field = 'ZZETARC'. "Z FIELD 2
ls_ext2-value = s_zdl20-zzetarc.
ls_ext2-type = 'CHAR'.
ls_ext2-length = '4'.
APPEND ls_ext2 TO lt_ext2.
CLEAR : ls_ext2.
ENDIF.
IF s_zdl20-zzetarcd IS NOT INITIAL.
ls_ext2-param = 'LIKP'.
ls_ext2-row = '1'.
ls_ext2-field = 'ZZETARCD'. "Z FIELD 2
ls_ext2-value = s_zdl20-zzetarcd.
ls_ext2-type = 'CHAR'.
ls_ext2-length = '120'.
APPEND ls_ext2 TO lt_ext2.
CLEAR : ls_ext2.
ENDIF.
**Bapi to change delivery
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE' (inside of this BAPI calling Badi IF_EX_SMOD_V50B0001~EXIT_SAPLV50I_010)
EXPORTING
header_data = ls_header
header_control = ls_header_control
delivery = s_dl20-vbeln
TABLES
extension1 = lt_ext1
extension2 = lt_ext2
return = ls_return.
* COMMIT WORK AND WAIT." UP TO 5 SECONDS .
READ TABLE ls_return WITH KEY type = 'E' TRANSPORTING
NO FIELDS .
IF sy-subrc <> 0.
*- Check for Abort message
READ TABLE ls_return WITH KEY type = 'A' TRANSPORTING
NO FIELDS.
IF sy-subrc <> 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.
ENDIF.
**To update the inbound idoc delivery level relation tab
obj_rola-objtype = 'IDOC'.
obj_rola-objkey = idoc_contrl-docnum.
obj_rolb-objkey = s_dl20-vbeln.
obj_rolb-objtype = 'LIKP'.
relation = 'IDC1' .
CALL FUNCTION 'BINARY_RELATION_CREATE'
EXPORTING
obj_rolea = obj_rola
obj_roleb = obj_rolb
relationtype = relation
EXCEPTIONS
OTHERS = 4.
COMMIT WORK.
ENDIF.
FREE : lt_ext1,lt_ext2,ls_return.
BADI code :
CLEAR ls_bapiextt.
READ TABLE extension2 INTO ls_bapiextt WITH KEY param = 'LIKP'
field = 'ZZETADATE'.
IF sy-subrc EQ 0.
cs_vbkok-zzetadate = ls_bapiextt-value.
ENDIF.
CLEAR ls_bapiextt.
READ TABLE extension2 INTO ls_bapiextt WITH KEY param = 'LIKP'
field = 'ZZETATIME'.
IF sy-subrc EQ 0.
cs_vbkok-zzetatime = ls_bapiextt-value.
ENDIF.
CLEAR ls_bapiextt.
READ TABLE extension2 INTO ls_bapiextt WITH KEY param = 'LIKP'
field = 'ZZETARC'.
IF sy-subrc EQ 0.
cs_vbkok-zzetarc = ls_bapiextt-value.
ENDIF.
CLEAR ls_bapiextt.
READ TABLE extension2 INTO ls_bapiextt WITH KEY param = 'LIKP'
field = 'ZZETARCD'.
IF sy-subrc EQ 0.
cs_vbkok-zzetarcd = ls_bapiextt-value.
ENDIF.
Best Regards,
Raghava
03-31-2016 9:17 AM
hi ,
I am using the same code for different Msg type and IDOC FM its working fine as per expectations.
But other msg type and FM Z_IDOC_INPUT_DELVRY its not working.
Best Regards,
Raghava
03-31-2016 10:52 AM
Issue solved my self thank you for your help.
Best Regards,
Raghava
03-31-2016 12:09 PM
03-31-2016 12:45 PM
In IDOC Z**FM
having different logic like SGI Split delivery check before posting PGI
Purcharse Order should be referred in invoice document and accounting document
for self billing invoices created using Consignment and Pipeline settlement (MRKO)
PO quantity when 3PL rejects the Qty.
where qty is zero after split process Change is only for SPL qualifier in Ship confirmation IDOC. Message : Z**.
Those many logic's are there to update delivery in same FM .
Previously i have written my code after all this process .
Now changed to before all this logic ..nothing more than that i didn't do.
Best Regards,
Raghava