cancel
Showing results for 
Search instead for 
Did you mean: 

File to IDOC scenario to send the amount to IDOC based on Credit or debit with +ve or -Ve

Former Member
0 Kudos

HI

I am working on File to IDOC scenario, and did the mapping.

It is based on company code at source and trigger IDOCs.

I am in a sitation that i am passing the Amount from Source to target(IDOC).  but the thing is i need to send the negative amount based on Credit.

right now my flow is like below:

companycode ---> removecontexts  --->

                                                                      sort by Key  ----> Splitby value change(Each)   ---> amount (in target IDOC)

amount (source)     --->removecontexts       --->

Please let me know how can i pass the negative value when the other fileld of Source is credit/debit.

Looks like simple....but tried to implement like below

          by using if condition  at the Source amount and sending the negative value....but no luck...

Please help...

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If i understood your req correctly then under source node there is one filed which can have "credit" or "debit" value and depending upon that field value u have to pass + or - values in amount field..

If yes, then chk below mapping:

Thanks

Amit

Message was edited by: Amit Srivastava

Former Member
0 Kudos

HI Amit,

It looks like your logic is working ....only the issue is for the first record as it is Credit and taking as (--)

double hyphen ...ie  - - 1000.88

where as for Debit it is taking as  ( - ) single hyphen...ie.  -1000.88

Which are wrong......need to do small correction.....

which will show as below

Credit    :     - 1000.88

Debit   :         1000.88

I changed my logic same way....Please help in this.

Thanks

Former Member
0 Kudos

Hi,

I guess you are adding extra "-" somewhere in ur mapping...cross chk the fix value mapping...use display queue option and chk the output of ur mapping function

Thanks

Amit Srivastava

Former Member
0 Kudos

Great...it was done....Thanks Amit..

Answers (1)

Answers (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

What is the reqirement to send negative/Positive values, give some sample values for creedit then we will try give logic.

Former Member
0 Kudos

Sample Data:

companycode               credit/debit               Amount

1000                                 C                         1234.00

1000                                 D                          1234.00

2000                                 C                          4321.00

2000                                  D                         4321.00

These are the few field values......so based on Compnay code i need to pass the first two records to a BAPI with amount one is positive and the second one is negative like this.... to post one IDOC.

have mentioned the logic above and see it below also that i am passing the amount to IDOC....

companycode ---> removecontexts --->

                                                     sort by Key  ----> Splitbyvalue(Each) -->amount (in target IDOC)

amount (source) ->removecontexts -->

thanks

Former Member
0 Kudos

did u check the mapping which i have mentioned above??

>>so based on Compnay code i need to pass the first two records to a BAPI

What do u mean by first two records??

for the above mentioend input what output u want?

Former Member
0 Kudos

checked your mapping......no luck...

with same company code we need to post one IDOC...if there are more than one row for the same companycode we need to post only one IDOC as line items...

rajasekhar_reddy14
Active Contributor
0 Kudos

Change split by value parameter to value change and use amith logic. it should work.