cancel
Showing results for 
Search instead for 
Did you mean: 

http client to synchronous BAPI

Former Member
0 Kudos

Hi,

i am preparing to provide training for TBIT40 to our customer, but i am standing on exercise 3 - http client to synchronous BAPI.

i created Z_BAPI_PO_CREATE and every step is ok, but

in interface mapping, i can not see xslt mapping defined by imported archives(PurchaseOrder_ZBAPI_PO_CREATE).

this step took me.

does anybody has any experience?

thanks

venjamin.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You may not have selected XSLT as mapping type .

Regards,

Alok

Former Member
0 Kudos

hI,

thanks very much i am stupid..

venjamin

Answers (3)

Answers (3)

francis21
Participant
0 Kudos

Hi Venjamin,

How did you create the custom wrapper BAPI Z_BAPI_PO_CREATE? Can you share the steps?

Thanks,

Francis

Former Member
0 Kudos

Hi,

Did u get the steps to create the custom wrapper BAPI Z_BAPI_PO_CREATE?

If yess can u please share them with me.

Thanks,

Pragati

francis21
Participant
0 Kudos

Hi Pragati,

Try this:

FUNCTION zbapi_po_create.

*"----


""Local Interface:

*" IMPORTING

*" VALUE(PO_HEADER) TYPE ZBAPI_PO_HEADER

*" VALUE(BYPASS_BAPI) TYPE CHAR1 OPTIONAL

*" EXPORTING

*" VALUE(PURCHASEORDER) LIKE BAPIEKKOC-PO_NUMBER

*" TABLES

*" PO_ITEMS STRUCTURE ZBAPI_PO_DETAIL

*"----


DATA bapi_po_schedules LIKE bapieket OCCURS 0 WITH HEADER LINE.

IF bypass_bapi NE ''.

CALL FUNCTION 'RANDOM_I4'

EXPORTING

rnd_min = 0

rnd_max = 1000000000

IMPORTING

rnd_value = purchaseorder.

ELSE.

LOOP AT po_items.

MOVE-CORRESPONDING po_items TO bapi_po_schedules.

ENDLOOP.

CALL FUNCTION 'BAPI_PO_CREATE'

EXPORTING

po_header = po_header

  • PO_HEADER_ADD_DATA =

  • HEADER_ADD_DATA_RELEVANT =

  • PO_ADDRESS =

  • SKIP_ITEMS_WITH_ERROR = 'X'

  • ITEM_ADD_DATA_RELEVANT =

  • HEADER_TECH_FIELDS =

IMPORTING

purchaseorder = purchaseorder

TABLES

po_items = po_items

  • PO_ITEM_ADD_DATA =

po_item_schedules = bapi_po_schedules.

  • PO_ITEM_ACCOUNT_ASSIGNMENT =

  • PO_ITEM_TEXT =

  • RETURN =

  • PO_LIMITS =

  • PO_CONTRACT_LIMITS =

  • PO_SERVICES =

  • PO_SRV_ACCASS_VALUES =

  • PO_SERVICES_TEXT =

  • PO_BUSINESS_PARTNER =

  • EXTENSIONIN =

  • POADDRDELIVERY =

COMMIT WORK.

ENDIF.

ENDFUNCTION.

Regards,

Francis

Former Member
0 Kudos

Hi,

I created a rfc using the code given by u, but on activating it the errormsg given is

"bypass_bapi " is not declared. Where do i declare it.

U r code was generating PO randomly, so i have removed that code so that PO is not generated randomly. The msg sent shows successfull status in moni, but the PO No. is not generated.

Can u help me out.

former_member187447
Participant
0 Kudos

hi pragathi,

could you please post the actual code for creating the RFC (ZBAPI_PO_CREATE) if you got it right and also as i am new to XI and i would like to know where should i plug in this ABAP code to create the RFC.

kalyan.

former_member187587
Contributor
0 Kudos

Hi venjamin.

I'm not sure what you mean so I'll give you two answers:

First, If you are missing the XSLT file,it is provided on the XI host server in the File system you have to look at the courses libraries.

If you are missing the XSLT mapping option on interface mapping. you have to go to edit mode,then click on the drop-down window in the interface mapping screen.then youll see 3 options: First one for your regular graphical mapping programs,second one for XSLT and the third one for java jars.

Hope this will solve the problem.

Good luck

Nimrod

bhavesh_kantilal
Active Contributor
0 Kudos

Venjamin,

ABAP and XSLT mapping have to be explicitly activated.

To do the same, check this blog,

Now that we have seen, what SAP XI has to offer on creating mappings,let us now see how we can activate the ABAP and XSLT mapping in the Integration repository if XI.

<i>For this, we need to set a parameter in the exchange Profile of XI. The URL for the same is http://XIHOME:50000/exchangeProfile.

We also need to set the parameter com.sap.aii.repository.mapping.additionaltypes with a value R3_ABAP|Abap-class;R3_XSLT|XSL</i>

/people/ravikumar.allampallam/blog/2005/02/10/different-types-of-mapping-in-xi

Regards,

Bhavesh