cancel
Showing results for 
Search instead for 
Did you mean: 

Extended Classic Scenerio and Vendor Text

Former Member
0 Kudos

This subject has been brought up before, I've reviewed all those messages. The standard SRM product does not replicate vendor text to the backend system in the extended classic mode.

Having said that, I've been trying to make this work and hope someone here can give me some insight on what I am doing wrong.

In my setup, SRM is using function module B46B_DPO_TRANSFER to send the purchase order to R/3. This fm has a table called i_longtext that contains the header text.

B46B_DPO_TRANSFER calls FUNCTION 'BBP_PO_INBOUND' DESTINATION lv_destination" to create the PO on R/3. This call is missing the POTEXTHEADER table definition. So, I've modified the call to include this table and also filled the table with the following values:

po_item = 00000

text_id = F01 "this value was obtained from the text type for purchase order header configuration settings in R/3"

text_form = *

text_line = "the message that was typed in the header text"

I can't seem to get the header text to appear on the purchase order in the backend, has anyone been successful in making this work?

Kind regards,

Shawn O'Connor

Accepted Solutions (1)

Accepted Solutions (1)

yann_bouillut
Active Contributor
0 Kudos

Hi,

You can transfer the long text to the backend through the <u>backend </u> bbp_po_inbound_badi :

METHOD if_ex_bbp_po_inbound_badi~bbp_map_before_bapi .

----


  • Purpose : The long text from EBP to R3 is not transferred by

  • SAP, so an RFC call is made to get the vendor

  • text in the EBP PO item.

----


  • Change History

----


*User ID: | Date | Description and Marker ..

----


  • | |

----


DATA: l_flag LIKE sy-subrc,

st_poitem TYPE bapimepoitem,

st_poitemx TYPE bapimepoitemx,

st_bbp_text TYPE bbps_if_bapimepotext,

st_bbp_hdtx TYPE bbps_if_bapimepotextheader,

st_bapi_text TYPE bapimepotext,

l_text TYPE sy-subrc.

DATA: lt_lines TYPE TABLE OF tline,

st_lines TYPE tline.

LOOP AT bbp_poitem INTO st_poitem WHERE delete_ind EQ space.

CLEAR lt_lines[].

CALL FUNCTION 'Z_EBP_PO_READ_TEXT' DESTINATION 'BACK' "<b>'your backend</b>'

EXPORTING

  • CLIENT = SY-MANDT

id = 'ITXT'

language = 'EN'

object = 'BBP_PD'

po_num = bbp_poheader-po_number

po_item = st_poitem-po_item

TABLES

lines = lt_lines[]

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

LOOP AT lt_lines INTO st_lines.

st_bapi_text-po_item = st_poitem-po_item.

st_bapi_text-text_id = 'F01'.

st_bapi_text-text_form = '*'.

st_bapi_text-text_line = st_lines-tdline.

APPEND st_bapi_text TO bapi_potextitem.

ENDLOOP. "loop at bbp_potextitem

ENDLOOP. "loop at bbp_poitem ..

ENDMETHOD.

Kind regards,

Yann

Answers (8)

Answers (8)

Former Member
0 Kudos

Shawn,

Can you also include the source code for :

'Z_RFC_MAPPING_PO_TEXT'

Former Member
0 Kudos

Russell-

Here you go...

function z_rfc_mapping_po_text.

*"----


""Local Interface:

*" IMPORTING

*" VALUE(I_PONUM) TYPE CHAR10

*" TABLES

*" T_HDRTXT STRUCTURE ZBBPPOTEXT OPTIONAL

*" T_ITMTXT STRUCTURE ZBBPPOTEXT OPTIONAL

*"----


*********************************************************************

  • PURPOSE: The long text from EBP to R3 is not transferred by SAP, *

  • So map EBP fields to R/3 fields. *

*********************************************************************

  • CHANGE LOG: *

*********************************************************************

data: w_po_objid type crmd_orderadm_h-object_id,

w_pohdr like bbp_pds_po_header_d,

w_poitm type bbp_pds_po_item_d,

t_poitm type table of bbp_pds_po_item_d,

t_longtxt type table of bbp_pds_longtext ,

w_longtxt type bbp_pds_longtext ,

w_hdrtxt type zbbppotext,

w_itmtxt type zbbppotext.

clear: w_po_objid, w_pohdr, w_poitm, w_longtxt, w_hdrtxt, w_itmtxt,

t_poitm, t_longtxt.

refresh: t_poitm, t_longtxt.

w_po_objid = i_ponum.

    • Get PO details using PO Number

call function 'BBP_PD_PO_GETDETAIL'

exporting

i_object_id = w_po_objid

importing

e_header = w_pohdr

tables

e_item = t_poitm

e_longtext = t_longtxt .

if not t_longtxt[] is initial.

    • If header texts found then append to header table

clear:w_longtxt.

loop at t_longtxt into w_longtxt where guid = w_pohdr-guid.

w_hdrtxt-zpo_num = w_pohdr-object_id.

w_hdrtxt-ztxt_id = w_longtxt-tdid.

w_hdrtxt-ztxt_form = w_longtxt-tdformat.

w_hdrtxt-ztxt_line = w_longtxt-tdline.

append w_hdrtxt to t_hdrtxt.

clear w_hdrtxt.

endloop.

    • If Item texts found then append to item table

clear:w_poitm.

loop at t_poitm into w_poitm where del_ind eq space.

clear:w_longtxt.

loop at t_longtxt into w_longtxt where guid = w_poitm-guid.

w_itmtxt-zpo_num = w_pohdr-object_id.

w_itmtxt-zpo_itm = w_poitm-comm_id.

w_itmtxt-ztxt_id = w_longtxt-tdid.

w_itmtxt-ztxt_form = w_longtxt-tdformat.

w_itmtxt-ztxt_line = w_longtxt-tdline.

append w_itmtxt to t_itmtxt.

clear w_itmtxt.

endloop.

endloop.

endif.

endfunction.

former_member671224
Participant
0 Kudos

Hi Shawn,

I'm having simlar scenario, could please help me to complete this?

In my case, user will place order from SRM using SC and PO will be created in R/3. The requirement is the email ID of the user who placed that order needs to be added to the PO header text in R/3 system.

For testing i just passed hard coded value to the table bapi_potextheader in method BBP_MAP_BEFORE_BAPI in BADI BBP_PO_INBOUND_BADI; But after creation of order in SRM, when I checked in R/3, through ME23N, the header text is blank for the respective PO.

Below is the code that;

data:

wa_headertxt type bapimepotextheader.

wa_headertxt-text_id = 'F01'.

wa_headertxt-text_form = '*'.

wa_headertxt-TEXT_LINE = '@email.com'.

append wa_headertxt to bapi_potextheader.

Could you please suggest how to resolve this?

Thanks,

Amal

Former Member
0 Kudos

Many thanks to all of your helpful reponses, we were finally successful in getting vendor text to transfer to the backend purchase order in an extended classic scenerio on SRM 4.0. The solution provided by Yann was the key. We implemented the bbp_po_inbound_badi on the R/3 side. Our code was placed in the BBP_MAP_BEFORE_BAPI method. I've pasted the code below, you may see a reference to eSpree in the comments, eSpree is what our company has named the SRM application.

Kind regards,

Shawn O'Connor

data: t_hdrtxt type table of bapimepotextheader,

w_hdrtxt type bapimepotextheader,

w_bapihtxt type bapimepotextheader,

t_itmtxt type table of bapimepotext,

w_itmtxt type bapimepotext,

w_bapiitxt type bapimepotext,

w_transid type zxref-ztransid,

w_in type zxref-zin,

w_out type zxref-zout,

w_dest type rfcdest.

clear: t_hdrtxt, t_itmtxt, w_hdrtxt, w_bapihtxt, w_itmtxt,

w_bapiitxt, w_transid, w_in, w_out, w_dest.

refresh:t_hdrtxt, t_itmtxt.

    • GET RFC DESTINATION

w_transid = 'ZRFCDEST'.

w_in = sy-sysid.

clear w_out.

call function 'Z_GET_XREF_VALUE'

exporting

i_xrefid = w_transid

i_input = w_in

importing

e_output = w_out

exceptions

nodatafound = 1

others = 2.

w_dest = w_out.

if not bbp_poheader-po_number is initial.

    • Look for only eSpree PO's

if ( bbp_poheader-doc_type eq 'ZCPO' ) or

( bbp_poheader-doc_type eq 'ZCDR' ) or

( bbp_poheader-po_number cp '44*' ) or

( bbp_poheader-po_number cp '43*').

    • Get Long text from SRM system with PO

call function 'Z_RFC_MAPPING_PO_TEXT'

destination w_dest

exporting

i_ponum = bbp_poheader-po_number

tables

t_hdrtxt = t_hdrtxt

t_itmtxt = t_itmtxt.

if not t_hdrtxt[] is initial.

    • If SRM PO Header text found map to R/3 PO

clear:w_hdrtxt.

read table t_hdrtxt into w_hdrtxt with key text_id = 'HTXT'.

if sy-subrc eq 0.

move-corresponding w_hdrtxt to w_bapihtxt.

w_bapihtxt-text_id = 'F01'.

w_bapihtxt-text_form = '*'.

append w_bapihtxt to bapi_potextheader.

clear w_bapihtxt.

endif.

    • If SRM PO Header note found map to R/3 PO

clear:w_hdrtxt.

read table t_hdrtxt into w_hdrtxt with key text_id = 'NOTE'.

if sy-subrc eq 0.

move-corresponding w_hdrtxt to w_bapihtxt.

w_bapihtxt-text_id = 'F02'.

w_bapihtxt-text_form = '*'.

append w_bapihtxt to bapi_potextheader.

clear w_bapihtxt.

endif.

endif.

    • If SRM PO Item text found map to R/3 PO

clear:w_itmtxt.

loop at t_itmtxt into w_itmtxt where text_id = 'ITXT'.

move-corresponding w_itmtxt to w_bapiitxt.

w_bapiitxt-text_id = 'F01'.

w_bapiitxt-text_form = '*'.

append w_bapiitxt to bapi_potextitem.

clear w_bapiitxt.

endloop.

    • If SRM PO Item note found map to R/3 PO

clear:w_itmtxt.

loop at t_itmtxt into w_itmtxt where text_id = 'NOTE'.

move-corresponding w_itmtxt to w_bapiitxt.

w_bapiitxt-text_id = 'F06'.

w_bapiitxt-text_form = '*'.

append w_bapiitxt to bapi_potextitem.

clear w_bapiitxt.

endloop.

endif.

endif.

Former Member
0 Kudos

Hi

Good to hear that your problem is resolved.

Thanks for sharing the information.

Regards

- Atul

imthiaz_ahmed
Active Contributor
0 Kudos

Implement the BADI "BBP_CREATE_BE_PO_NEW". Refer to the parameter "CS_PO_DOCUMENT". It's nested structure. If you open the structure, you will find "IT_PO_ITEM_TEXT". Populate this.

Regards,

IA

Former Member
0 Kudos

Atul-

Thank you for your reply. We are currently utilizing the BBP_CATALOG_TRANSFER BADI to enable the passing of Vendor Text from the Vendor's external website to SRM. This works perfectly, the problem is that our business would like that vendor text to also flow into the purchase order when it is copied to R/3 (we are using extended classic scenerio so it is a copy not a create). This is where the problem lies. The BBP_PO_INBOUND function does not contain the longtext parameter, so consequently the longtext is not copied to R/3. I think Yann may be on the right track by utilizing the BAPI in R/3 to call SRM and retrieve the longtext to update the PO. I will try that and post the results. Thanks again for your input, I have rewarded points.

Best regards,

Shawn

Former Member
0 Kudos

Hi

<u>I already told you about BBP_CREATE_PO_BACK BADI. Please cofirm whether you are not getting the long text passed from SRM system inside this BADI in the table et_longtext[]</u>

<u><i>Before the item, account, long text data is passed to the BAPI_PO_CREATE in order to create a back-end document in R/3 system, you can modify the data avaiable in this BADI.</i></u>

<i>Also, you can use either BBP_DOC_CHANGE_BADI for the filter type - BUS2201 (POs) and then can find the long text available there.</i>

Hope this will help.

Please reward suitable points.

Regards

- Atul

Former Member
0 Kudos

Yann,

Thank you for your response. I am going to try this, I will post the results. I've awarded points.

Thanks again,

Shawn

Former Member
0 Kudos

Hi

Any updates ? Is the problem resolved ?

If yes, Please reward suitable points.

Else, let me know.

Regards

- Atul

Former Member
0 Kudos

No, the problem is not resolved. The problem is that the BADI's you referenced do not have a table for longtext.

Regards,

Shawn

Ramki
Active Contributor
0 Kudos

Hi Shawn

If you are in SRM5.0, why don;t we use BBP_LONGTEXT_BADI ?

This BADI is used (one of the uses only is listed below):

o To define the copying rules for copying text types between SRM

documents and to define the mapping rules for the transfer of texts

from an SRM document to a backend document

- see method Define Copying Rules

Best regards

Ramki

Former Member
0 Kudos

Ramki-

Thank you for your reply, however we are on SRM 4.0

Best regards,

Shawn O'Connor

Ramki
Active Contributor
0 Kudos

Hi Shawn

SAP has provided correction notes for including long texts in change badi (see notes 845306, 897637 etc).

If you have oss message, may be SAP will help you here also.

Best regards

Ramki

Former Member
0 Kudos

Hi

<i>Incase BBP_LONGTEXT_BADI does not helps, then you can use the BADI, which i mentioned in my earlier post.</i>

<b>In the BADI - BBP_CATALOG_TRANSFER, there is a table structure, which holds the long text data.

Refer table ET_SC_LONGTEXT inside ENRICH_ITEM_DATA method of this BADI.</b>

<u>Here is the documenatation of this BBP_CATALOG_TRANSFER BADI.</u>


____________________________________________________
Short Text
Transfer Shopping Cart from Catalog

You can use the Business Add-In BBP_CATALOG_TRANSFER to change or add to the data that the catalog returns to SAP Enterprise Buyer via the catalog interface.

Note that your changes also affect the following applications in SAP Enterprise Buyer:

Confirm Goods Receipt/Service Entry
Plan Products for Maintenance Order
The call of this BAdI occurs in function module 'BBP_WS_IMPORT_SC_DATA'. This module is called by the relevant application to import catalog items previously sent by the browser of the user to the application Web server from there. After the catalog has transferred the data to SAP Enterprise Buyer the system carries out the following actions.

Conversion of ISO code of unit of measure and currency to SAP format
Conversion of price field to SAP format
In the case of transfer of a material or service number:
The system reads the product master with this number. If the number exists, the system transfers from the product master record the description and the purchase order unit of measure.
In the case of a partner number:
The system reads the business partner master with this number. If the number does not exist, the number in the shopping cart item is reset.
Note

In previous Releases, only the tables with the prefix "ENRICHED" were available. These were then returned to the calling application and transferred to the relevant document structure from there. From this Release on, the data is transferred from the current document structure to the application. The relevant tables are included as additional parameters (parameters with the prefix "ET_SC_").

New implementations should use these tables only and set the parameter "ev_sc_structures_used". In order that previous implementations need not be changed, a mapping occurs after the BADI. The parameter controls the mapping direction:

Set: New structure overwrites old structure

Not set: Old structure overwrites new structure









In the method ENRICH_ITEM_DATA, the following parameters are available:

catalog_content
This parameter contains the original data that the catalog transferred to the catalog interface. The structure corresponds exactly to the catalog interface. The data in this parameter is only for information purposes, you make any changes in the parameters et_sc_item_data , et_sc_accounting, et_sc_partner, et_sc_orgdata, et_sc_longtext, and et_sc_messages.
Note
The catalog interface also contains customer fields that you can use for your own purposes. You can pass these on in fields that the application can use further.


enriched_item_data
This parameter contains the data for a shopping cart item in Enterprise Buyer.
Note
This table should not be used in new implementations (see above Note).

enriched_acct_data
This parameter contains all account assignment fields. This parameter is empty at this time in the standard system.
Note
This table should not be used in new implementations (see above Note).

enriched_item_longtext
This parameter contains the long texts for the items.

Note
This table should not be used in new implementations (see above Note).
catalog_content_errors
This parameter contains the error messages that occurred when the catalog items were being enriched.

Note
This table should not be used in new implementations (see above Note).

ev_sc_structures_used
This parameter has to be set if the following tables are used in the implementation (recommended procedure, see Note above) et_sc_item_data This parameter contains the data of a shopping cart item in Enterprise Buyer.

et_sc_accounting
This parameter contains all account assignment fields. In the standard system, this parameter is empty at this time.

et_sc_partner
This parameter contains the links to the requester and the supplier, if used.

et_sc_orgdata
This parameter contains the links to the org. data for the partners from 

et_sc_partner.

et_sc_longtext
This parameter contains the long texts for the items.

et_sc_messages
This parameter contains the error messages that occurred during enrichment of catalog items. If this table contains a message of type 'E', the item causing this error is not transferred to et_sc_item_data. If the item is added in the BADI again (from the data from catalog_content), the relevant error message should be deleted, since the current SRM Server application generally searches this table for error messages of type 'E' in order to output an error message to the user.

Hope this will help.

Please reward suitable points.

Regards

- Atul

Former Member
0 Kudos

Hi

<u>Yes ...

this type of requirement we have handled quite a long time back.</u>

I don't remmber correctly.

<b>But you can try implementing the following BADIs as these are vailable in SRM 4.0 version.

BBP_CREATE_PO_BACK

and

BBP_CATALOG_TRANSFER</b>

I wl get you on this very soon.

Hope this will help.

Please reward suitable points.

Regards

- Atul

former_member195032
Active Contributor
0 Kudos

I will suggest you a way.

Use BADI : BBP_ECS_PO_OUT_BADI

Use Parameter : CT_BAPI_POHEADER_TEXT

and Modify the code as below.

In Spro->SRM Server->Cross Application Basic Setting->Text Schema ->Define Text Type

In Spro->SRM Server->Cross Application Basic Setting->Text Schema ->Define Text Schema

for PO Text for Schema

It is HTXT at header level.

Just modify it with PO text ID.

I think ,it ia A01.Just check this.

I have done it for contract.

<b>

Sample code is for contract.Change it for PO</b>

LOOP AT ct_be_text INTO lw_ct_be_text.

if lw_ct_be_text-tdid = 'HTXT'.

lw_ct_be_text-tdid = 'K00'. " release order text in CTR

MODIFY ct_be_text FROM lw_ct_be_text.

endif.

ENDLOOP.

Let me know if you are stuck up.

Regards,Nishant

<b>Please reward points if this helps</b>

Message was edited by:

Nishant Rajan

Former Member
0 Kudos

Nishant-

Thank you for your response. I have rewarded points. Question: I don't have the text schema node in my SPRO transaction, any ideas?

Best regards,

Shawn O'Connor

Former Member
0 Kudos

The BBP_ECS_PO_OUT_BADI BADI does not have a parameter called CT_BAPI_POHEADER_TEXT. There is one called CS_BAPI_HEADER_EXT but this is not the structure for texts.

regards,

Shawn

Ramki
Active Contributor
0 Kudos

Hi Shawn

Nishant's reply is applicable only from SRM50 onwards.

Best regards

Ramki