cancel
Showing results for 
Search instead for 
Did you mean: 

BBP_PD_PO_GETDETAIL returns empty item[], condition[] first time

Former Member
0 Kudos

Hi Expert,

I have implimented BADI BBP_DRIVER_DETERMINE and assign custom FM zB46B_DPO_TRANSFER to create PO in backend system.

When I create PO and order it first time... FM zB46B_DPO_TRANSFER is getting called where I want to read PO item condition using FM BBP_PD_PO_GETDETAIL and pass to fm which creates PO in backend.

FM BBP_PD_PO_GETDETAIL is returning blank table PRIDOC[] (pricing data).

I pass guid of the PO to the FM to get the details.

for the saved PO it return every details perfectly.

Do I need to read from buffer or what... how ???

Thanks,

Rajesh.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi ,

Try to read from buffer.

The below code will work in change Badi so definitely it will work in your badi also.

DATA: lo_pd_model TYPE REF TO /sapsrm/if_pdo_model_access.

lo_pd_model = /sapsrm/cl_pdo_model_factory=>get_instance( ).

lo_pd_model->get_detail(

EXPORTING

iv_guid = is_header-guid

iv_with_itemdata = abap_TRUE

IMPORTING

es_header = li_header

ET_PRIDOC = LT_PRIDOC ).

if the above method is not working then get the buffer instance for /SAPSRM/CL_PDO_BO_PO_ADV.

data lo_pdo_po TYPE REF TO /sapsrm/if_pdo_bo_po_adv.

CALL METHOD /sapsrm/cl_pdo_factory_po_adv=>get_buffered_instance

EXPORTING

iv_header_guid = ls_header-guid

RECEIVING

ro_instance = lo_pdo_po.

check the implementation class /SAPSRM/CL_PDO_BO_PO_ADV which method is suitable to get the condition records.

the below code is sample method how to call ....

TRY.

CALL METHOD lo_pdo_po->/sapsrm/if_pdo_do_schedules~get_schedule_line

EXPORTING

iv_item_guid = ls_item-guid

IMPORTING

et_sdln = lt_sdln

eo_meta_data_handler = lo_meta_data_handler

CHANGING

co_message_handler = lo_message_handler.

CATCH /sapsrm/cx_pdo_abort .

CATCH /sapsrm/cx_pdo_no_authorizatio .

ENDTRY.

regards,

Devi