cancel
Showing results for 
Search instead for 
Did you mean: 

Do not create line item segment on the target side if quantity is 0

Former Member
0 Kudos

Hello All

I am working on SHPORD message type which is IDOC to File scenario. There is a line item segment on Source side E1EDL24 mapped to line item segment on the target side ORDERDETAIL. My requirement is ORDERDETAIL segment should not be created if the field LFIMG under the segment E1EDL24 is equal to ZERO. Could somebody tell me how to achieve this.

Thanks

Naga

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Thanks Aamir and Gaurav, I got the required output.

Naga

Former Member
0 Kudos

Gaurav

It did not work. In my mapping LFIMG is mapped to Quantity field which is under OrderDetail. So if LFIMG is 0, then I should not create Order Details at all.

For example, if I have two line items in a Delivery and if E1EDL24-LFIMG for both the line items is 10 and 20 then two ORDERDETAILS nodes have to be created.

If one of the line items quantity is equal to 0 then only one ORDERDETAIL node has to be created.

Thanks

Naga

Former Member
0 Kudos

Hi Naga

Are you mapping the above logic to Quantity or OrderDetail

map LFIMG to Quantity and the above logic to Orderdetail

If LFIMG is 0 then Orderdetail will not be created and if not then Quantity will have value from LFIMG field

Check this for more understanding of CreateIf

http://help.sap.com/saphelp_nw70/helpdata/EN/d9/3033f96c79674f90e3ab8d101a595b/content.htm

Thanks

Gaurav

Former Member
0 Kudos

Hi Naga

You can do it with standard Mapping functions




E1EDL24
     LFIMG -> Equals (0 or ZERO) -> Not -> CreteIf - Receiver Node

it is interpreted like this

Target = CreateIf(Not(LFIMG =0)) 

if LFIMG = 0 return true then Not make it false and node is not created

if LFIMG = 0 return false then Not make if true and node is created

Thanks

Gaurav

Edited by: Gaurav Bhargava on Oct 11, 2008 4:32 AM

Former Member
0 Kudos

Aamir

How do I do that, do I have to write an UDF function. Could you please explain in detail.

Thanks

Naga

Former Member
0 Kudos

Hey

There is no UDF involved in this,all are standard functions.

First use the equalS standard function to compare LFIMG and 0,feed the output of this to NOT function,then feed its output to createIf function and then map it to the receiver field.

Thanx

Aamir

Former Member
0 Kudos

Use the following logic

[{(LFIMG equalS 0)NOT}createIf]--->ReceiverNode

Thanx

Aamir

Edited by: Aamir Suhail on Oct 10, 2008 2:34 PM