cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass a value from an extension field to another extension field of differents BOs?

0 Kudos

Hi everybody.

I'm trying to pass a data that is an extension field in another that is also an extension field. The case is the following, I have a CustomerInvoice BO, this BO has an extension field named FolExt and I have a CustomerInvoiceRequest BO, this BO has an extension field named FolExt2. I want to pass the value from CustomerInvoiceRequest.FolExt2 to CustomerInvoice.FolExt, is this possible? and if yes, How to do it?

I hope somebody can help me.

Thank you for advance.

Best Regads.

Accepted Solutions (1)

Accepted Solutions (1)

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Ismael,

You have several possibilities:

- Annotation Reference:

     If You have defined the extension field FolExt1 in the CustomerInvoice BO like this

     element FolExt1 : <any type>;

     You can reference this field in the  CustomerInvoiceRequest BO like this

     [Reference] element FolExt1;

   

     You need to use the same name, but without any data type.

     The value will be transfered from one BO to the other.

- Annotation Scenario

     You extend a Process Scenario (Add -> New Item -> Process Scenario Extension) from the namespace "http://sap.com/xi/AP/CustomerInvoicing/Global" with the CustomerInvoice BO.

     Please mark the "Invoce Request" scenario.

     Then you can use this definition for your extension element

     [Scenario(<name of process scenario extension>)] element FolExt1 : <any type>;

     The system will assign this element FolExt1 to all BO/nodes which are part of the marked scenarios of the Process Senario Extension.

- Via Business Transaction Document (BTD) and ABSL

     As the CustomerInvoice is created from a CustomerInvoiceRequest you can retrieve the required information (NodeId / AltKey of the CustomerInvoiceRequest) from the node BusinessTransactionDocumentReference.

     From here you can use the approach suggested by Allessandro via ABSL

HTH,

   Horst

0 Kudos

Hi Horst.

I have followed this steps that you provided me.

- Annotation Reference:

     If You have defined the extension field FolExt1 in the CustomerInvoice BO like this

     element FolExt1 : <any type>;

     You can reference this field in the  CustomerInvoiceRequest BO like this

     [Reference] element FolExt1;

     You need to use the same name, but without any data type.

     The value will be transfered from one BO to the other.

But I can't pass the data, the extension field in CustomerInvoice is null, I just have the extension field to both BOs and their enhace screens.. is there any step more that I have to do?.

if you need more details about this topic, please, let me know.

Thank you so much for advance.

Best regards.

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Ismael,

I am sorry to say that I was on the wrong track and I put you on the same wrong track.

(Somebody told me: "Refrence is the poor man's Secnario")

First: If you use the Scenario annotation, PDI takes care of both

- Assigning the element to every node of the scenario

- Populate the element accoring to the document flow

Second: If you use the Refrence annotation, PDI takes only care of

- Assigning the element to every node where you used the Reference annotation

As there is no pre-known document flow, PDI is not able to populate the element with the correct data.

So you need to add the ABSL part for the data itself.

HTH,

   Horst

0 Kudos

Hi Horst.

Don' worry, so, Thanks so much for your comments.

Then if I need implement ABSL code, but, I have a doubt, is there any field that I can use to identify the link between a CustomerInvoice BO and a CustomerInvoiceRequest BO?

I'm searching a field that both BOs are sharing and I can use to pass the extension field from customerInvoiceRequest to CustomerInvoice.

I hope you can help me.

thank you very much.

Best Regards.

Former Member
0 Kudos

Hi Ismael, do you have the CustomerInvoice BO reference in the CustomerInvoiceRequest BO, such as ID and so on?

If yes you can query all CustomerInvoices using this reference as selection parameter.

Otherwise if you have an association in the CustomerInvoiceRequest to the corresponding CustomerInvoice, you can directly take the value. Check via repository explorer.

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Ismael,

In the BO CustomerInvoiceRequest there is an association / node BusinessTransactionDocumentReference.

From this node there is a association CustomerInvoice.

CustomerInvoiceRequest -> BusinessTransactionDocumentReference -> CustomerInvoice

Use this association to find the resp. CustomerInvoice.

HTH,

    Horst

0 Kudos

Hello Horst

Sorry by delay, I'm having problems to find the association that you comment.

This node "CustomerInvoiceRequest -> BusinessTransactionDocumentReference -> CustomerInvoice" don't exists.

I'm working in a 1308v tenant, I hope this information can helps you to understand me.

is there any node that can helps me??

Thank you very much for advance.

Sincerely.

Ismael Lara

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Ismael,

I've checked the BTD CustomerInvoiceRequest in 1308 and I am sorry to say, that the association I mentioned

     CustomerInvoiceRequest -> BusinessTransactionDocumentReference

is not in the Public Solution Model.

But at the root node of the CustomerInvoiceRequest there is an element named ReferenceBusinessTransactionDocumentID which is in the PSM.

This element is the ID of another BTD.

If you can access with this ID a CustomerInvoice (the ID of a CustomerInvoice is an Alternative Key) then the reference of the CustomerInvoiceRequest is indeed a CustomerInvoice.

HTH,

    Horst

Former Member
0 Kudos

Hi Ismael Lara


    There is very simple way to pass data from customer invoice request to customer invoice by using Process Extension.

     You can easily pass extension field data through process extension .


first step

     On 1308 Sdk system , Add new item >> process extension  [.xs file]


In Customer invoice request

[Scenario (InvReqCustInvoices)] [Label("Hours")] element Hours:DecimalValue;

  [Scenario (InvReqCustInvoices)] [Label("Charge Out Rate")] element ChargeOutRate:DecimalValue;

  [Scenario (InvReqCustInvoices)] [Label("Cost Object")] element CostObject:FinancialAccountingViewOfCostObjectID;

  [Scenario (InvReqCustInvoices)] [Label("Overhead Rate")] element OverheadRate:DecimalValue;

Add field in Customer invoice request through extension explorer

Then just go to  customer invoice xbo and exhance the screen customerinvoiceoif

Goto the extension explorer

and add extension field

Directly you got extension field of customer invoice request.

thanks

gorakh

0 Kudos

Hi Gorakhnath.

Thank you very much for your help, your solution is the best and really easy.

Best regards and thanks again

Sincerely.

Ismael Lara

Former Member
0 Kudos

Hi everybody.

Thanks for the excellent advice here. I followed it and got things rolling.

I have a problem though. If I have a manual invoice request and select "save as invoice" then the fields work perfectly.

However if I select "release" from the manualinvoicerequest.oif then the fields do not get populated.

I think I am missing something simple. Any ideas?

Former Member
0 Kudos

Hi Eoin Pierce McKenna

     Please follow above mentioned step for transferring data from customer invoice request to customer invoice.

regards.

Gorakh

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ismael,

if these two BO are connected, for example by an association, you can assign the value in ABSL in the after-modify event implementation.

If not, please provide more information about your scenario.