cancel
Showing results for 
Search instead for 
Did you mean: 

Urgent : Need initial Quote prize(1 st Version) form all item of Quotation number. Need to know the link between ‘BBP_PDHAD_V’ and ‘BBP_PDIGP’

former_member950986
Discoverer
0 Kudos

Dear All Expert,

Need initial Quote prize form Quotation number. Need to know the link between ‘BBP_PDHAD_V’ and ‘BBP_PDIGP’

I have did this but for performance i dont want to use FM BBP_PD_QUOT_GETDETAIL. Please check my way :-

I have did this:

SELECT guid object_id created_at
INTO TABLE it_version_data
FROM bbp_pdhad_v
FOR ALL ENTRIES IN it_obj_id “ List of all object id
WHERE object_id EQ it_obj_id-object_id.

“For one quotation there may be N number of version so I am sorting it and “deleting adjacent duplicates by comparing Object id.

SORT it_version_data BY object_id created_at ASCENDING.
DELETE ADJACENT DUPLICATES FROM it_version_data COMPARING object_id.

“ So now I have all quotation numbers with their first Version Guid.

Now I am using FM ‘BBP_PD_QUOT_GETDETAIL’

CALL FUNCTION 'BBP_PD_QUOT_GETDETAIL'
EXPORTING
i_guid                            = wa_version_data-guid " GUID of 1st Version of Quataion

         i_object_id                       = wa_ version_data-object_id

       TABLES
e_item                            = it_item
*       E_VERSION                         = It_VERSION
.

“And I get all item in IT_ITEM with their initial price.

“Using loop I will get item with price in FIRST QUOTAION

LOOP AT it_item INTO wa_item.
wa_e_t_data-object_id = wa_obj_id-object_id.
wa_e_t_data-part_no = wa_item-ZZPARTNO.
wa_e_t_data-DESCRIPTION = wa_item-DESCRIPTION.
wa_e_t_data-price = wa_item-price.

IF wa_e_t_data IS NOT INITIAL.
APPEND wa_e_t_data TO e_t_data.
ENDIF.

ENDLOOP.

It is working fine. But As it Is run for all records in table it is taking too much of time.

Now I know that Table : BBP_PDIGP have price for version. But I don’t know the link between ‘bbp_pdhad_v’ and BBP_PDIGP. If you help me then instead of loop I will use for all entries and make performance faster.

Please Advice...

Accepted Solutions (1)

Accepted Solutions (1)

robin_janke
Contributor
0 Kudos

Hi,

bbp_pdigp-guid = crmd_orderadm_i-guid , crmd_orderadm_i-header = bbp_pdhad_v-guid.

Regards,

Robin

former_member950986
Discoverer
0 Kudos

Thanks Robin for quick reply..

Well I pick GUID form BBP_PDHAD_V table by providing Object id = ' Quote Number'

Now when I try to pick data form given combination :

crmd_orderadm_i-header = bbp_pdhad_v-guid.


I did not get any records from CRMD_ORDERADM_I table.





former_member950986
Discoverer
0 Kudos

Actually I have also try

First pick GUID form header table :

CRMD_ORDERADM_H - Object = Quote no.

Then pick guid from Item table

CRMD_ORDERADM_I-HEADER = CRMD_ORDERADM_H-GUID

If I pass this guid to BBP_PDIGP then I got records but this is Final version price not first version price.

Answers (0)