on 01-16-2013 1:49 PM
Hi All,
Need help in executing if condition in seeburger mapping...
Requirement : If qualifier value is x then map edi date value with idoc value, if qualifier value is y then map same date edi value with same idoc value..but if both the qualifier is present, then map only for x value and not for y value...
Solution I used: When I tried to put below condition it mapped for both when both qualifier are present. I want it should fetch data only for qualifier x when both qualifier are present....
if qualifier = x
copy edi field with idoc field
else
if qualifier = y
copy edi field with idoc field
endif
endif
Please help me in putting the condition...we should use if or any other condition.
Thanks
Hi,
you could test like:
if qualifier = y
copy edi_field_variable with idoc field
endif
if qualifier = x
copy edi_field_variable with idoc field
endif
copy edi field with edi_field variable
In this case it first copies the value of y to a variable...and only overwrites it with the value of x if x is existing
And if x doesn´t exist...the value of y is still in the variable at the point when the last line ( that copies to edi field) is executed
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefan,
Thanks a lot for the reply.
When I tried the above option, it fetched both the values with the qualifier again.
Last command was successful in both the cases when qualifier is x first condition is successful and edi field is map with idoc field. Then it checked the other field and it didnt overwrite it but mapped the idoc and edi field when qualifier is y...So it mapped in both the cases instead of writing only one.
Is their any other wayout?
Requirement is as below:
If qualifier of DTM segment is 64 it should map DTM e02 with idoc field, if it is 2 it should map DTM e02 with idoc field and if both qualifier are present then it should map only 64 qualifier DTM e02 value with the idoc
Below is the file sample file
UNA:+.? '
UNB+UNOC:2+................
UNH+1+ORDERS:D:96A:............
BGM+220+........
DTM+137:20121206:102'
DTM+64:20121217:102'
UNT+20+1'
UNH+2+ORDERS:.........
BGM+220+.........
DTM+137:20121206:102'
DTM+63:20121217:102'
................
UNT+20+2'
UNH+3+ORDERS:D:..............
DTM+137:20121206:102'
DTM+2:20121217:102'
..................
UNT+20+3'
UNH+4+ORDERS:D:......................
BGM+220+2846523-D'
DTM+137:20121206:102'
DTM+2:20121220:102'
DTM+64:20121217:102'
.....................
UNT+21+4'
UNH+5+ORDERS:D....................
BGM+220+2846523-E'
DTM+137:20121206:102'
DTM+64:20121217:102'
DTM+2:20121220:102'
............................
UNT+21+5'
UNZ+5...........
Requirement is as below:
If qualifier of DTM segment is 64 it should map DTM e02 with idoc field, if it is 2 it should map DTM e02 with idoc field and if both qualifier are present then it should map only 64 qualifier DTM e02 value with the idoc
Below is the file sample file
UNA:+.? '
UNB+UNOC:2+................
UNH+1+ORDERS:D:96A:............
BGM+220+........
DTM+137:20121206:102'
DTM+64:20121217:102'
UNT+20+1'
UNH+2+ORDERS:.........
BGM+220+.........
DTM+137:20121206:102'
DTM+63:20121217:102'
................
UNT+20+2'
UNH+3+ORDERS:D:..............
DTM+137:20121206:102'
DTM+2:20121217:102'
..................
UNT+20+3'
UNH+4+ORDERS:D:......................
BGM+220+2846523-D'
DTM+137:20121206:102'
DTM+2:20121220:102'
DTM+64:20121217:102'
.....................
UNT+21+4'
UNH+5+ORDERS:D....................
BGM+220+2846523-E'
DTM+137:20121206:102'
DTM+64:20121217:102'
DTM+2:20121220:102'
............................
UNT+21+5'
UNZ+5...........
I am using below code....which is fetchin me write value for 64 qualifier value and if 64 and 2 both are present, but not fetching value when only 2 is there...
if UNB.SG0.UNH.DTM:C507.2005 ="64" //"64" Delivery Date/Time
copy UNB.SG0.UNH.DTM:C507.2380 to EDI_DC40.E1EDK01.E1EDK03:DATUM;
if UNB.SG0.UNH.DTM:C507.2005 ="2" or UNB.SG0.UNH.DTM:C507.2005 ="64"
copy "002" to EDI_DC40.E1EDK01.E1EDK03:IDDAT; //"002" Requested Delivery date
overwrite UNB.SG0.UNH.DTM:C507.2380 to EDI_DC40.E1EDK01.E1EDK03:DATUM;
endif
endif
Hello,
the code above cannot work, since you have the condition for "64" in the most outer loop, means if the condition "64" is not existing...the next if-statement that checks for "2" is never executed.
The following example-structure has separate if-statements for 64 and 2, so if only 1 of the 2 values is available, it is put to the Ioc-field.
But if both are available the following conditions apply:
- If both are existing (first 2 then 64) then the 64 value is taken (and overwrites the 2 value)
- If both are existing (first 64 then 2) then the 2 is NOT overwriting the 64 (check_flag prevents this) and still the value 64 is taken,
-----------------------------------
copy "NO_64" to check_flag$
if qualifier = "64"
copy DTM:C507.2380 to variable$
copy "64EXIST" to check_flag$
endif
if qualifier = "2"
if check_flag$ = "NO_64"
copy DTM:C507.238 to variable $
endif
endif
copy variable$ with to E1EDK03:DATUM
---------------------------
So in summary, it is always taking the "64" and only in the case where only the "2" is available, this value is taken.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.