cancel
Showing results for 
Search instead for 
Did you mean: 

Custom field values are not being transfered to the backend system

Former Member
0 Kudos

Hi,

I have applied the OSS Notes 458591 & 672960 for adding the custom field as checkbox in shopping cart at item level and maintained the same field in Backend system in customer includes CI_EKPODB & CI_EKPODBX, still the custom field value is not transfering to the back end system but the value is storing in SRM system.

Please advice me on this regard.

Thanks in advance.

-Satish

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

The Backend PO is created by calling the Function B470_PO_CREATE in SRM.Debug this function to see if the field mapping is OK.

If not you may have to map them exclusively and also adjust the BADI structures to accomodate the new fields.The BADI is BBP_CREATE_PO_BACK.

Raghu

Former Member
0 Kudos

Hi Raghu,

Thanks for your fast response. when i am trying to execute this FM in debug mode, in the starting itself it is showing sy-subrc = 4 and not at all entering into the mapping part. Could you please suggest me on this regard.

Thanks in advance.

-Satish

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Satish,

I had the same problem on my last project.

My cust fileds where not present in the backend PO. This was due to the type of some of these fields.

My workaround on that is to implement BADIs in SRM and R/3. Here is a sample of code to get your fields back:

- BBP_ECS_PO_OUT_BADI in SRM (I was working in extended classic scenario)

<i>METHOD if_ex_bbp_ecs_po_out_badi~bbp_b46b_po_outbound.

[...]

    • Customer fields

MOVE 'POHEADER' TO w_customer_fields-refobject.

*PO approver

MOVE 'ZZAPPROVER' TO w_customer_fields-fieldname.

MOVE is_header-zzlastapprover TO w_customer_fields-container.

APPEND w_customer_fields TO ct_bapi_customer_fields.

*SC Date

MOVE 'ZZSCDATE' TO w_customer_fields-fieldname.

MOVE lv_scheader-created_at TO w_customer_fields-container(15).

APPEND w_customer_fields TO ct_bapi_customer_fields.

*Requester Org

MOVE 'ZZORGA' TO w_customer_fields-fieldname.

MOVE w_requester_orgunit TO w_customer_fields-container.

APPEND w_customer_fields TO ct_bapi_customer_fields.

[...]</i>

- BBP_PO_INBOUND_BADI in R/3.

<i>method IF_EX_BBP_PO_INBOUND_BADI~BBP_MAP_BEFORE_BAPI.

data wa_customer_fields TYPE BBPS_IF_CUSTOMER_FIELDS.

data : WA_BAPI_TE_MEPOHEADER type BAPI_TE_MEPOHEADER,

WA_BAPI_TE_MEPOHEADERX type BAPI_TE_MEPOHEADERX.

data WA_EXTENSIONIN TYPE BAPIPAREX.

data txt_960(960) type c.

[...]

      • EKKO Customer fields.

*PO Number

move BBP_POHEADER-PO_NUMBER to WA_BAPI_TE_MEPOHEADER-PO_NUMBER.

move BBP_POHEADER-PO_NUMBER to WA_BAPI_TE_MEPOHEADERX-PO_NUMBER.

*ZZAPPROVER

READ TABLE BBP_CUSTOMER_FIELDS INTO wa_customer_fields

WITH KEY refobject = 'POHEADER'

fieldname = 'ZZAPPROVER'.

IF SY-SUBRC EQ 0.

MOVE wa_customer_fields-container TO WA_BAPI_TE_MEPOHEADER-ZZAPPROVER.

WA_BAPI_TE_MEPOHEADERX-ZZAPPROVER = 'X'.

endif.

*ZZSCDATE

READ TABLE BBP_CUSTOMER_FIELDS INTO wa_customer_fields

WITH KEY refobject = 'POHEADER'

fieldname = 'ZZSCDATE'.

IF SY-SUBRC EQ 0.

MOVE wa_customer_fields-container TO WA_BAPI_TE_MEPOHEADER-ZZSCDATE.

WA_BAPI_TE_MEPOHEADERX-ZZSCDATE = 'X'.

endif.

*ZZORGA

READ TABLE BBP_CUSTOMER_FIELDS INTO wa_customer_fields

WITH KEY refobject = 'POHEADER'

fieldname = 'ZZORGA'.

IF SY-SUBRC EQ 0.

MOVE wa_customer_fields-container TO WA_BAPI_TE_MEPOHEADER-ZZORGA.

WA_BAPI_TE_MEPOHEADERX-ZZORGA = 'X'.

endif.

CLEAR txt_960.

CLEAR WA_EXTENSIONIN.

write WA_BAPI_TE_MEPOHEADER to txt_960 left-justified.

WA_EXTENSIONIN-STRUCTURE = 'BAPI_TE_MEPOHEADER'.

WA_EXTENSIONIN-VALUEPART1 = txt_960(240).

WA_EXTENSIONIN-VALUEPART2 = txt_960+240(240).

WA_EXTENSIONIN-VALUEPART3 = txt_960+480(240).

WA_EXTENSIONIN-VALUEPART4 = txt_960+720(240).

append WA_EXTENSIONIN to BAPI_EXTENSIONIN.

CLEAR txt_960.

CLEAR WA_EXTENSIONIN.

write WA_BAPI_TE_MEPOHEADERX to txt_960 left-justified.

WA_EXTENSIONIN-STRUCTURE = 'BAPI_TE_MEPOHEADERX'.

WA_EXTENSIONIN-VALUEPART1 = txt_960(240).

WA_EXTENSIONIN-VALUEPART2 = txt_960+240(240).

WA_EXTENSIONIN-VALUEPART3 = txt_960+480(240).

WA_EXTENSIONIN-VALUEPART4 = txt_960+720(240).

append WA_EXTENSIONIN to BAPI_EXTENSIONIN.

endmethod.</i>

Good luck .

Vadim

Former Member
0 Kudos

Hi Vadim,

I am working on SRM 4.0 & ECC 5.0 in classic scenario. Will this code applicable to my landscape?

Thanks,

Satish

Message was edited by: Satish Ponakala

Former Member
0 Kudos

Hi,

This was done on SRM 4.0 with R/3 4.6C.

You have to figure out if the PO BAPI in R/3 still works the same way.

As you can see in the R/3 Badi code, I just filled in 2 structures that are taken after by the standard.

My advice: Try and you'll see.

Regards.

Vadim

PS: Sorry I didn't see you told you're in classic scenario.

In this case you'll have to adapt it:

The SRM Badi is not the same for PO transfer, but I think the Backend one is the same.

Good luck.

Vadim

Message was edited by: Vadim COURTHEOUX

Former Member
0 Kudos

Hi Vadim,

You are talking about the fields which are added in the Header level. In my requirement i have added in the item level as a checkbox. I have maintained the same field in EKPO table as well. So it has to go to EKPO table. How will i do for item level customer field data transfering to backend system?

Please provide me the solutions.

Thanks,

Satish

Message was edited by: Satish Ponakala

Former Member
0 Kudos

Hi Satish,

First I want to notice that both Raghu Vallam and I provided you some clues on your issue, and you didn't reward anything for that: keep in mind it is important to keep poeple helping you on your issues

Concerning your question. You'll have to adapt the code I provided you to work with the items: all the ...POHEADER... parameters or values will be changed into ...POITEM..., and EKKO will be changed into EKPO as you noticed.

Try the implementation, and get back to me with your issues if you have some.

Regards.

Vadim

Former Member
0 Kudos

Hi Vadim,

I am really very sorry. I am not noticing that, i am in tension to delever this object.

I have implemented the badi as you said, when i check the syntax it is giving the warning message as " After enhancement you may not be able to convert the structure wa_bapi_te_mepoitem into a character-type field and would then be no longer be allowed as a operand. allowed ".

Will this gives any side effects while transfering the data to backend? Please let me know

Thanks,

Satish

Former Member
0 Kudos

Hi,

As you can see in the code, the structure "wa_bapi_te_mepo..." is written into a text field, and then into WA_EXTENSIONIN structure.

So I think your message wont have any side effects.

But the real question is : Does it work, do you have now your fields in the R/3 document ?

Regards.

Vadim

Former Member
0 Kudos

Hi Satish,

If you are in Classic, you should be cloning the Driver FM applicable to your R/3 release and map your custom fields into extension structures and pass it to BAPI_PO_CREATE. You will call this cloned driver in the Driver Determine BADI or adjust table BBP_FUNCTION_TAB based on your SRM release. This is in SRM side.

Then, in R/3, you map this field into relevent application structure fields like EKPO in the user exit and update the R/3 table using BAPI_PO_CHANGE.

BTW, i am working in B2B, EBP and SRM now since 2001, have been using SAP Community forum, somehow i am missed this forum so far.

Of late i found a lot going in this forum, wanted to participate actively.

Vadim is doing great here.

Thanks,

Jay

Former Member
0 Kudos

Hi Vadim,

I have added the code as you suggested. Still it is not working. Can you please provide me any other solutions?

And one more thing.. After adding the custome fields in the incl_* structures. I am getting this field in Basic data actual screen. But it is supposed to come in subscreen for additional fields and also it is strangely displaying two buttons as "Add Blank Lines" & "Transfer Changes". Please provide me the solution for this as well.

Thanks,

Satish

Message was edited by: Satish Ponakala

Former Member
0 Kudos

Hi,

So lets restart, and give me more details.

1-Your working on SRM 4.0 in classic mode with an ECC 5.0.

please confirm.

2- You defined customer fields in SRM SC.

Provide the detail of these fields (with data type) and the structures in which they are defined in SRM.

3- You defined customer fields in ECC 5.0 on the PO.

Provide the detail of these fields (with data type) and the structures in which they are defined in ECC.

Also define how they are shown on ECC 5.0 (which tab)

4- give us the exact code you implemented in SRM and ECC Badis (check you activated the BADIS, and not only the ABAP code)

-


To check what's going on try the following:

0- In ECC 5.0 change the SRM RFC user type to dialog user with SAP_ALL rights to be abble to debug from SRM

1- create a new SC that needs approval(to be sure it is not transfered)

2- in SRM launch in debug mode the FM BBP_REQREQ_TRANSFER (it is the one that is called at the end of the WF)

3- While debuging check your going through the BADIs you've implemented on SRM and ECC 5.0, and try to find out what's going wrong

Regards.

Vadim

Former Member
0 Kudos

Hi Vadim,

1. Yes, i am working on SRM 4.0 Classic Scenario with ECC 5.0 as the backend system.

2. field name : ZZSUS_DEV_IND, Data element ZSUS_DEV_IND, domain XFELD.

In SRM side added in follwing structures..

INCL_EEW_PD_ITEM_CSF

INCL_EEW_PD_ITEM_CSF_PO

INCL_EEW_PD_ITEM_CSF_SC

INCL_EEW_PD_ITEM_CST_PO

INCL_EEW_PD_ITEM_CST_SC

3. In R/3 Side

CI_BBP_IT

CI_EKPODB

CI_EKPODBX

4. Code implemented in R/3 side in BADI : BBP_PO_INBOUND_BADI in method IF_EX_BBP_PO_INBOUND_BADI~BBP_MAP_BEFORE_BAPI

data: wa_customer_fields TYPE BBPS_IF_CUSTOMER_FIELDS,

WA_BAPI_TE_MEPOITEM type BAPI_TE_MEPOITEM,

WA_BAPI_TE_MEPOITEMX type BAPI_TE_MEPOITEMX,

WA_EXTENSIONIN TYPE BAPIPAREX.

data txt_960(960) type c.

*ZZSUS_DEV_IND

READ TABLE BBP_CUSTOMER_FIELDS INTO wa_customer_fields

WITH KEY refobject = 'PO_ITEM' fieldname = 'ZZSUS_DEV_IND'.

IF SY-SUBRC EQ 0.

MOVE wa_customer_fields-container TO

WA_BAPI_TE_MEPOITEM-ZZSUS_DEV_IND.

WA_BAPI_TE_MEPOITEMX-ZZSUS_DEV_IND = 'X'.

endif.

CLEAR txt_960.

CLEAR WA_EXTENSIONIN.

write WA_BAPI_TE_MEPOITEM to txt_960 left-justified.

WA_EXTENSIONIN-STRUCTURE = 'BAPI_TE_MEPOITEM'.

WA_EXTENSIONIN-VALUEPART1 = txt_960(240).

WA_EXTENSIONIN-VALUEPART2 = txt_960+240(240).

WA_EXTENSIONIN-VALUEPART3 = txt_960+480(240).

WA_EXTENSIONIN-VALUEPART4 = txt_960+720(240).

append WA_EXTENSIONIN to BAPI_EXTENSIONIN.

CLEAR txt_960.

CLEAR WA_EXTENSIONIN.

write WA_BAPI_TE_MEPOITEMX to txt_960 left-justified.

WA_EXTENSIONIN-STRUCTURE = 'BAPI_TE_MEPOITEMX'.

WA_EXTENSIONIN-VALUEPART1 = txt_960(240).

WA_EXTENSIONIN-VALUEPART2 = txt_960+240(240).

WA_EXTENSIONIN-VALUEPART3 = txt_960+480(240).

WA_EXTENSIONIN-VALUEPART4 = txt_960+720(240).

append WA_EXTENSIONIN to BAPI_EXTENSIONIN.

And also the problem is the custom field is displaying in the basic data screen as normal standard screen field i mean instead of displaying in the additional fields subscreen and additional fields subscreen has got new buttons as "Add Blank Lines" & "Transfer Changes". These are not supposed to diplay here.

I hope with these details you can solve my problem....

Thanks,

Satish

Former Member
0 Kudos

Hi Vadim,

Are you able find out the problem with given details, Please let me know or please try to give some more inputs to solve this issue.

Thanks & Regards,

Satish.

Former Member
0 Kudos

Hi Satish,

Did you look at the second part of the message ?

Concidering your description, I'm not abble to identify the issue without accessing the system.

You now have to debug the SPOOL_DPO_TRANSFER (or ...transfer_do) Function Module to get the exact problem

0- Be sure to make your R/3 RFCUSER a dialog user to be able to debug R/3 from SRM

1- Put a breakpoint on your SRM BADI implementation

2- Launch the SPOOL_DPO_TRANSFER FM in debug mode

3- Run till your BADI breakpoint.

4- run and check step by step your customer field

Good luck.

Vadim

Former Member
0 Kudos

Hi Satish,

Raghu and me gave some pointers earlier for Classic case. I am not sure you looked those replies.

I had successfully transferred Custom fields for many of my clients with that approach. Pls explore SMOD MM06E005 in R/3 for Customer fields in purchasing document and create Project in CMOD to transfer Custom field values to the backend. Just a hint, You will use EXIT_SAPMM06E_016 within SMOD MM06E005 to update EKPO table with Custom field values.

The BADI you are trying will work Extended Classic, not for Classic.

Thanks,

Jay

Former Member
0 Kudos

Sorry, I forgot you're working in classic mode.

Then the procces is:

0- Be sure to make your R/3 RFCUSER a dialog user to be able to debug R/3 from SRM

1- Create a SC that needs at least one level of approval, order it without approving

2- Put a breakpoint on your SRM BADI implementation

3- Launch the BBP_REQREQ_TRANSFER FM in debug mode

3- Run till your BADI breakpoint.

4- run and check step by step your customer field.

Regards.

Vadim

Former Member
0 Kudos

Hi Jay,

Thanks for your message. it is really helping out. Can you please provide me some sample code how you have written earlier for populating the custom fields.

Thanks & Regards,

Satish

Former Member
0 Kudos

Hi Satish,

I assume you do not have any problem in SRM side, you do not see custom fields updated in R/3 EKPO structure.

As i said earlier you will use SAP enhancement and create a project. Use Function Exit EXIT_SAPMM06E_013 in there to update in R/3 EKPO structure. Here is the pseudo.

" Custom Field from SRM, will go to ekko-quotation an Ex:-

it_ekko-quotation = i_ekko-zangnr. " Custom Field from SRM

it_ekkox-quotation = 'X'.

if v_upd_lines > 0 or it_ekkox is not initial.

CALL FUNCTION 'BAPI_PO_CHANGE' IN BACKGROUND TASK

EXPORTING

PURCHASEORDER = i_ekko-ebeln

POHEADER = it_ekko

POHEADERX = it_ekkox

MEMORY_UNCOMPLETE = i_ekko-memory

MEMORY_COMPLETE = i_ekko-memory

IMPORTING

expheader = v_expheader

TABLES

return = i_return

poitem = i_poitem

poitemx = i_poitemx.

DESCRIBE TABLE i_return LINES v_err_lines.

IF v_err_lines = 0.

COMMIT WORK. " AND WAIT.

ENDIF.

ENDIF.

Similarly, you will do for Item also. Good Luck.

Thanks,

Jay

Former Member
0 Kudos

Hi Vadim,

I am implementing sourcing dashboard.

I am facing problem while implementing the badi BBP_ECS_PO_OUT_BADI in SRM..

i have written following code in BBP_ECS_PO_OUT_BADI in SRM

method IF_EX_BBP_ECS_PO_OUT_BADI~BBP_B46B_PO_OUTBOUND.

data : ls_item type BBP_PDS_PO_ITEM_D,

ls_cust type BBPS_IF_CUSTOMER_FIELDS_PI.

loop at it_item into ls_item.

ls_cust-refobject = 'POITEM'.

ls_cust-fieldname = 'ZSRMCATALOGID'.

ls_cust-container = ls_item-catalogid.

append ls_cust to ct_bapi_customer_fields.

endloop.

endmethod.

i have created field zsrmcatalogid field in R3 in EKPO table.and i am now implementing the Badi in R3 for BBP_PO_INBOUND_BADI ...can any one help me out for coding in the R3 for this badi...in extended classic scenario.

yann_bouillut
Active Contributor
0 Kudos

Hi Venu,

Please open a new thread.

Kind regards,

Yann

Former Member
0 Kudos

Hi Vadim,

I m also facing the same problem in BAPI Extension.

My bapi is BAPI_PO_CREATE1

Pls help me.

Thanks in Advance.

Regards,

Shiv