cancel
Showing results for 
Search instead for 
Did you mean: 

Pre-fix text maintained in z table to Vendor text in cart

nevin_philip
Participant
0 Kudos

We have to create a Z table in SRM which will contain company code,account assignment category, business partner and text.Based on the values selected while creating the cart if it has the combination of company code,account assignment and business partner the corresponding text is picked from the z table and appended to the text in the vendor text which flows to requisition. Can you suggest the BADI which we can use so that we can get this combination and also how do we pre fix the value to the vendor text.Appreciate your quick response

Accepted Solutions (1)

Accepted Solutions (1)

robin_janke
Contributor
0 Kudos

Hi,

the bbp_doc_change_badi is the badi you are looking for with filter value BUS2121.

Pseudo code missing some steps:

1. get details using bbp_pd_sc_getdetail, because sometimes item data/accounting data/org data is not filled

2. read ztable using values

3. loop at items

4. loop at longtext for tdid 'ITXT' = vendor text on item level and guid = item guid

5. if ztable text not already there: concat ztable text and longtext into string

6. fill longtext table again

4b endloop

3b endloop

Regards,

Robin

nevin_philip
Participant
0 Kudos

Thanks robin...but in the doc change badi i was not able to get the partner number but instead was able to get only partner GUID. we need to get business partner data(vendor number).Can we pre-pend the text to the existing text in the vendor text

robin_janke
Contributor
0 Kudos

In the parameter partner you have 3 fields:

partner_guid = unique guid for the partner for this document

partner_no = unique guid in the system for this partner (BUT000: partner_guid)

partner_id = business partner id, in the case of suppliers this is the vendor number.

So the bp is there as far as I know.

Answers (4)

Answers (4)

nevin_philip
Participant
0 Kudos

Thanks Robin and Janke.I will check with the development team tomorow and will let you know.Thanks a lot for your help and i guess i would require your help in completing this.:).will update

nevin_philip
Participant
0 Kudos

Thanks Naveen and Robin..

Naveen, i dont have much idea on technical things but where do we define this piece of code...is it in the start or in the loop where we fetch values from Z table

Are there any impacts while doing this

Former Member
0 Kudos

Hi Nevin,

In the steps mentioned by Robin, in the 1st step instead of using the bbp_pd_sc_getdetail, use the code mentioned abvove and carry out the rest of the steps as mentioned by Robin.

Regards,

Naveen

robin_janke
Contributor
0 Kudos

Talk to your developer for this, with the information that we have given it should be no problem for him to develop the needed functionality.

The code should be before the loop as it retrieves the information to loop over.

Former Member
0 Kudos

Hi Nevin,

SRM has a buffer , which is updated from the UI. Sometime the buffer data and the bbp_pd_sc_getdetail data may be different. Dont ask me why and in which case. But I have noticed this.

So in order to get the accurate data you can do so by executing the below code in the change badi

CALL METHOD /sapsrm/cl_pdo_model_factory=>get_instance

     RECEIVING

       eo_instance = lo_pdo_model.

   CALL METHOD lo_pdo_model->get_detail

     EXPORTING

       iv_guid     = es_header-guid

     IMPORTING

       et_item     = int_item

       et_partner  = int_partner

       et_longtext = int_longtext

       es_header   = fs_header

Use the internal tables to manipulate the data and then pass them to the change badi's exporting parameters.

See if this helps.

Regards,

Naveen

nevin_philip
Participant
0 Kudos

Thanks a lot Robin..We will check this out.How do we get the business partner number from the partner guid and how do we get the account assignment . Will this loop be called always while clicking any button in the shopping cart