Skip to Content
0

how to use NRO object in multimapping message split

Jun 22, 2017 at 10:41 AM

109

avatar image
Former Member

Hi guruz

my requirement is that i am sending incoming B2B IDOCs data to an RFC as well as a file using multimapping

I made an NRO using

http://: /webdynpro/dispatcher/sap.com/nro~maintenance/NROMaintenance.

and mapping it in

message1 rfc data as well

message 2 file

i want same NRO to be passed to both but it is taking next number to message2 file.

is there anyway that we can pass same value to both ??

i saw this blog but couldn't get any help https://blogs.sap.com/2016/09/01/use-case-nro-api-access-dynamic-counter-variable/

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

7 Answers

Manoj K Jun 22, 2017 at 12:59 PM
1

Naina,

You can access NRO in mapping via UDF and you can map the outcome of this UDF to both the messages.

https://answers.sap.com/questions/180346/b2b-add-on-nronumber-range-object-usage-in-file-na.html?childToView=181715#answer-181715

Br,

Manoj

Share
10 |10000 characters needed characters left characters exceeded
Mate Moricz
Jun 22, 2017 at 11:09 AM
0

Hi Naina,

I assume that you added the constant $B2B_UEBNR<nroName>$B2B_END_UEBNR to both messages and that's why the NRO increased for both message 2. You can also get the last number again by using the constant $B2B_UEBNR_BEFORE<nroName>$B2B_END_UEBNR in case of message 2 file.

Best regards,

Mate

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Mate

I tried this but my both messages are 0....unbounded and $B2B_UEBNR_BEFORE<nroName>$B2B_END_UEBNR is picking the last value to everyplace in RFC

example

if both message 1 and 2 are executed 5 times after split

for message 1 $B2B_UEBNR<nroName>$B2B_END_UEBNR is giving

12341

12342

upto 12345

and for message 2 it is giving

12345

12345

12345 to every 5 field i have assigned it in message 2
and if i apply $B2B_UEBNR<nroName>$B2B_END_UEBNR to message 2 as well

then i am getting

12346

12347

and so on

whereas i wanted

12341

12342

upto 12345

in message 1 and 2 both when the mapping is executed....

0

Hi Naina,

It is getting clearer now. You should refer to Manoj's reply, if you use the NRO API you can achieve the results you need.


Best regards,
Mate

0
Iñaki Vila Jun 22, 2017 at 12:52 PM
0

Hi Naina,

In a multimapping you are generating two or more messages, therefore to have the same NRO number, it doesn't seem to be right. I think you should think about the possibility to generate this number earlier.

Regards.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Iñaki

yes i think you are right.

can you please check my reply below and let me know if there is smth that you can think of.

0
Raghuraman S Jun 26, 2017 at 07:59 AM
0

Hello Naina,

Did u run it end-end and check?.

Are you getting the logs in channel that NRO is called?

AFAIK RFC gets executed faster that IDOC, so you might need to delay the mapping of RFC using UDF.

Share
10 |10000 characters needed characters left characters exceeded
Raghuraman S Jun 22, 2017 at 02:57 PM
0

you can even create 2 NRO Numbers with same start and other values.

In the mapping you can append the constant value and increment it

$B2B_UEBNR<nroName_1>$B2B_END_UEBNR For first map call

$B2B_UEBNR<nroName_2>$B2B_END_UEBNR For second map call

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jun 22, 2017 at 04:10 PM
0

let me explain my receiver structure and requirements thoroughly

<messages>
      <message1> cardinality 0.....unbounded
         field1 (NRO)
         field2
               field21(NRO)
      </message1>
      <message2> cardinality 1 
         field3
              field31(NRO)
      </message2>
</messages>

when mapping is executed i want the same NRO number to be assigned to field1, field21(child of field2 message1) and field31(child of field3 message2).is this somehow possible.

i thought of using variable in reciver maping assigning NRO to that and later on using the variable everywhere. 
but this NRO is not getting assigned to the variable and its passing same string "$B2B_UEBNR<nroName_2>$B2B_END_UEBNR" to  the variable.
can i write the udf to read NRO and pass it variable as a value and then assign variable to fields.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jun 22, 2017 at 04:14 PM
0

one more issue that is happening

message1 is idoc

message2 is rfc

i have maintained order at runtime in ICO and still is executing RFC first and IDOC second.

Share
10 |10000 characters needed characters left characters exceeded