cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping to BAPI structure

Former Member
0 Kudos

Hi, Dear Friends!

I need to implement the Mapping between mt_sender and BAPI_ACC_DOCUMENT_POST.


Sourse:
Tree			Occurrences
--------------------------------------
mt_sender		1..1
  LINES			1..unbounded
     DETAILS		1..1
	DATE		1..1
	COST_CENTER	0..1
	DEBET		1..1
	CREDIT		1..1
	SUMMA		1..1
	TAX_CODE	0..1
	DESCRIPTION	1..1

Target:
Tree			Occurrences
--------------------------------------
BAPI_ACC_DOCUMENT_POST	1..1
   DOCUMENTHEADER	1..1 
      BUS_ACT		0..1	
      HEADER_TXT	0..1	
      COMP_CODE		0..1	
      DOC_DATE		0..1	
      PSTNG_DATE	0..1	
      DOC_TYPE		0..1	
  ACCOUNTGL		0..1
      item		0..unbounded
	 ITEMNO_ACC	0..1
	 GL_ACCOUNT	0..1
	 TAX_CODE	0..1
	 COST_CENTER    0..1
	 DE_CRE_IND	0..1
  CURRENCYAMOUNT	0..1
      item		0..unbounded
	 ITEMNO_ACC	0..1
	 CURRENCY	0..1
	 AMT_DOCCUR	0..1

In my mapping I need to fill only two subnodes item both in structure ACCOUNGL and CURRENCYAMOUNT of BAPI by the following way:


BAPI_ACC_DOCUMENT_POST			
   DOCUMENTHEADER	1..1
      BUS_ACT		0..1	RFBU
      HEADER_TXT	0..1	mt_sender->LINES->DETAILS->DESCRIPTION
      COMP_CODE		0..1	1000
      DOC_DATE		0..1	mt_sender->LINES->DETAILS->DATE
      PSTNG_DATE	0..1	mt_sender->LINES->DETAILS->DATE
      DOC_TYPE		0..1	SA
  ACCOUNTGL		0..1
      item		0..unbounded (1)
	 ITEMNO_ACC	0..1	1
	 GL_ACCOUNT	0..1	mt_sender->LINES->DETAILS->DEBET
	 TAX_CODE	0..1	H0
	 COST_CENTER    0..1	COST_CENTER
	 DE_CRE_IND	0..1	S
      item		0..unbounded (2) <------------------- ADD SECOND ITEM ----
	 ITEMNO_ACC	0..1	2
	 GL_ACCOUNT	0..1	mt_sender->LINES->DETAILS->CREDIT
	 TAX_CODE	0..1	
	 COST_CENTER    0..1	
	 DE_CRE_IND	0..1	H
  CURRENCYAMOUNT	0..1
      item		0..unbounded (1)
	 ITEMNO_ACC	0..1	1
	 CURRENCY	0..1	UAH
	 AMT_DOCCUR	0..1	mt_sender->LINES->DETAILS->SUMMA
      item		0..unbounded (2) <------------- ADD SECOND ITEM ----
	 ITEMNO_ACC	0..1	2
	 CURRENCY	0..1	UAH
	 AMT_DOCCUR	0..1	mt_sender->LINES->DETAILS-> -SUMMA

Please advice me how to add second items to ACCOUNTGL and CURRENCYAMOUNT in order to specify the different relations?

Thank you in advance,

Maslova Natalia.

Accepted Solutions (1)

Accepted Solutions (1)

prabhu_s2
Active Contributor
0 Kudos

right click and duplicate subtree/node. u can try this out...but aint sure if this works in bapi's

Former Member
0 Kudos

Yes, I tried to do it. In context menu on subnode item I chose "Duplicate Subtree". But without results. May be I need to set something or may be BAPI structure can not be modified and duplicate subtree I must do by dynamic predefined functions at runtime? Or is it bug and I need patch?

prabhu_s2
Active Contributor
0 Kudos

maybe u can create a strucutre having the strucutres and fields for what is required and repeat the step duplicate subtree step for that u had defined. using proxies implement the method and call the bapi inside the method. u can have better control of the process as u want

Former Member
0 Kudos

Thank you!

May be another approach to sovle my task - applying the Node Functions from Mapping Editor. Which of them do you recommend me?

With the best regards,

Natalia

prabhu_s2
Active Contributor
0 Kudos

<b>Or is it bug and I need patch?</b>

i dont think so it is a bug or u req a patch. i doubted for it to work. as far as BAPI it is another f/n module that is remote enabled. hence it may not be techncailly possible to alter the occurenece (duplication) of exporting, importing or table parameters.

prabhu_s2
Active Contributor
0 Kudos

maybe even the node functions may not help you. what u are looking is to have duplicated nodes which i think is not possible with bapi's.

but why do u require to duplicate the paramters?

Former Member
0 Kudos

Yes, really, BAPI work good, I tested it. I understand, that BAPI has unchangeable structure. And I don't want to change BAPI structure. BAPI provide unbounded number of subnode occurrences, I need two types of them with different relations. So I need tool (may be menu item) for such mapping in XI.

prabhu_s2
Active Contributor
0 Kudos

the next option maybe cloning to std BAPI to a Z bapi and perhaps in that u can create one more parameter and handle it accordingly inside the bapi

Former Member
0 Kudos

Dear Prabhu!

I don't want to change BAPI! BAPI is very good!

I don't know how in Mapping Editor implement required mapping for me.

I try to explain:

BAPI represent one document which can consist of unbounded positions.

Positions is implemented by subnodes <b>item</b> in substructures <b>ACCOUNTGL</b> and <b>CURRENCYAMOUNT</b> in BAPI

In my case I need only 2 positions. But information for these two positions (<b>item</b>) is different.

So I need to set different mapping in bounds subnode <b>item</b>.

Now I set mapping for subnodes <b>item</b>, but only for <b>first </b>type - as I represent in my first message. I need to add mapping for <b>second</b> type - as I represent in the same my first message, but with arrows <b><----


</b>

With the best regards,

Natalia

prabhu_s2
Active Contributor
0 Kudos

Hi

As far i've seen in SDN there are no tools that does dupliate the parameters in BAPI. Eventhough if u are able to do it with help of some tool it will not work out at BAPI end. The reason is as pointed earlier the strucutre occurence cannot be changed in bapi.

As far i have seen ur requirment, the reason for duplicating the parameter ACCOUNTGL is for balancing the debit and credit and the same with CURRENCYAMOUNT. Since the child ITEM of both parameters are 0..unbounded you dont req to duplicate the parameter just map the source to target and ITEM carries more than one data as per the definition. This shud surely solve the problem. If this is not the one u are looking for maybe u need to consider of cloning the std bapi.

Answers (0)