on 08-16-2014 12:03 PM
Hello Experts,
We are facing a strange issue.We are using SRM 7.0. The test run field in FM B46B_DPO_TRANSFER is always set to 'X' .We are unable to find why this field I_TESTRUN is always X. This field (I_TESTRUN) is stopping the PO from getting transferred to back end. Please suggest why this issue occurs and how can we make this test run initial.
Thanks in Advance.
Thanks & Regards,
Aishwarya.M
Hello Aishwarya Mudam,
Regarding B46B_DPO_TRANSFER for I_TESTRUN check your code , have you passed the value abap_true for I_TESTRUN ,due to which it will be X. Moreover I would suggest to use META_DPO_TRANSFER. Try it and let me know.
Thanks
Gaurav Gautam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gaurav,
Thanks for the response.
yes in FM B46B_DPO_TRANSFER we are passing abap_true to the i_testrun parameter, which is an exporting parameter in this FM. Even in META_DPO_TRANSFER , this parameter is set to abap_true.
Recently we upgraded our dev system with new support pack. before this patch work this parameter used to be initial . but now it is always set to 'X'. Please suggest how to proceed furthur.
Thanks & Regards,
Aishwarya.M
Hello Aishwarya Mudam,
Would suggest to create a copy of the FM and then remove the export parameter to blank. We also did the same but in my case I used Meta_dpo_transfer FM . If you are using FM SPOOL_DPO_READ_BAPI_EXPORTS then I_testrun should be passed as export parameter for B46B_DPO_TRANSFER. If you want to pass I_testrun as default blank then you should create a ZFM and then call the FM. Let me know what exactly you are trying to build .
Thanks
Gaurav Gautam
Hi Gaurav,
We are using SPOOL_DPO_READ_BAPI_EXPORTS FM where in we are passing I_testrun as exporting parameter with value abap_true, this FM is executing successfully without any errors. please find the below sequence of code.
call function 'SPOOL_DPO_READ_BAPI_EXPORTS'
exporting
i_guid = mv_header_guid
i_targetappl_type = /sapsrm/if_pdo_bo_po_c=>gc_targetappl_exec
i_testrun = abap_true
importing
e_header = ls_header
e_logical_system = lv_logical_system
et_attach = lt_attach
tables
e_item = lt_items
e_account = lt_account
e_partner = lt_partner
e_confirm = lt_confirm
e_longtext = lt_longtext
e_limit = lt_limit
e_sdln = lt_sdln
e_orgdata = lt_orgdata
e_tax = lt_tax
e_messages = lt_messages_tmp
e_actval = lt_actval
e_acc_actval = lt_acc_actval
e_header_rel = lt_header_rel
e_itmlim_rel = lt_itmlim_rel
e_status = lt_po_status
e_tolerance = lt_tolerance
exceptions
internal_error = 1
others = 2.
if lv_logical_system is initial.
ls_messages-msgty = 'E'.
ls_messages-msgid = 'BBP_ADMIN'.
ls_messages-msgno = '127'.
ls_messages-msgv1 = ls_header-object_id.
ls_messages-msgv2 = /sapsrm/if_pdo_bo_po_c=>gc_targetappl_exec.
append ls_messages to ct_messages.
return.
endif.
if sy-subrc eq 0 and lv_logical_system is not initial.
sort lt_account by acc_no ascending.
" Call META_DPO_TRANSFER in test run mode.
call function 'META_DPO_TRANSFER'
exporting
i_header = ls_header
i_logical_system = lv_logical_system
i_targetappl_type = /sapsrm/if_pdo_bo_po_c=>gc_targetappl_exec
it_attach = lt_attach
i_testrun = abap_true
tables
i_item = lt_items
i_account = lt_account
i_partner = lt_partner
i_confirm = lt_confirm
i_longtext = lt_longtext
i_limit = lt_limit
i_sdln = lt_sdln
i_orgdata = lt_orgdata
i_tax = lt_tax
i_actval = lt_actval
i_acc_actval = lt_acc_actval
i_header_rel = lt_header_rel
i_itmlim_rel = lt_itmlim_rel
i_status = lt_new_status
e_messages = lt_messages_erp
control_record = lt_control_record
i_tolerance = lt_tolerance.
After execution of SPOOL_DPO_READ_BAPI_EXPORTS FM it is directly going to test run execution of meta_dpo_transfer which internally calls B46B_DPO_TRANSFER .we are using this i_testrun parameter as a check before transferring the attachment form SRM to ECC. As it is always set to 'X' we are unable to transfer the attachments. Please suggest what to do.
Thanks & Regards,
Aishwarya.M
Hello Aishwarya,
Can you please let me know what exactly are you trying to do. As I coded the same at for me it's working fine as whatever you are passing in SPOOL for I_testrun , same will be used by Meta_dpo_transfer. Also as you said it calls internally B46B_DPO_TRANSFER, then yes you are correct as when you directly call B46B_DPO_TRANSFER then there is a problem with control_record as it doesn't get fills and always you will find an error. Now can you pass blank instead of abap_true and check again.
Thanks
Gaurav Gautam
Hi Gaurav,
Actually we are trying to transfer an attachment form SRM to ECC. we implemented BBP_B46B_PO_OUTBOUND BADI, which is called when the PO is ordered. we are using I_TESTRUN as importing parameter and executing the BADI based on this parameter value.
If I_testrun is initial then BADI should be executed if not it should skip the attachment creation.
So BADI BBP_B46B_PO_OUTBOUND is triggered from META_DPO_TRANSFER. so as this FM is taking i_testrun as always abap_true, its skipping the BADI code. Please suggest how to solve this as everything are standard.
Thanks & Regards,
Aishwarya.M
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.