Posted: Tue Jul 15, 2008 9:29 am Post subject: For Statement with Condition
Acolyte
Joined: 28 Jun 2007 Posts: 51
Hello Everyone,
Can anyone tell me how to write a FOR statement looping through an SAP structure along with a condition attached to it.Such that I obtain a Sub Array
I have searched the help and found out the
Code:
FOR ALL Body.Invoice.Purchases."Item"[] AS I (I.Quantity <= 50)
But Iam failing to implement the same with namespaces around it .Iam facing syntatical errors.Please give an example if you have implemented.
I want something like this...
Code:
FOR InInbound01Ref AS InputRoot.MRM.NS01:Data_record.NS03:sap_y_pedigree_inbound01_cwdata.NS03:sap_y_pedigree_inbound01_z2ymput_pedinds000.NS04:sap_y_pedigree_inbound01_z2ymput_pedinds000[] DO
FOR InD010Ref AS InputRoot.MRM.NS01:Data_record.NS03:sap_y_pedigree_inbound01_cwdata.NS03:sap_y_pedigree_inbound01_z2ymput_pedinds000.NS04:sap_y_pedigree_inbound01_z2ymput_pedinds000[] where InD010.ref='SOMEINPUT' DO
and thus obtain a sub array. _________________ Thanks and Regards,
Akir
Tell everyone what you want to do and someone will want to help you do it.-W. Clement Stone
FOR InputRoot.MRM.NS01:Data_record.NS03:sap_y_pedigree_inbound01_cwdata.NS03:sap_y_pedigree_inbound01_z2ymput_pedinds000.NS04:sap_y_pedigree_inbound01_z2ymput_pedinds000[] AS InInbound01Ref DO
or you can try something like this
Code:
DECLARE RefToItem REFERENCE TO InputRoot.MRM.NS01:Data_record.NS03:sap_y_pedigree_inbound01_cwdata.NS03:sap_y_pedigree_inbound01_z2ymput_pedinds000.NS04:sap_y_pedigree_inbound01_z2ymput_pedinds000[1];
FOR RefToItem (RefToItem.ref='SOMEINPUT') DO
--coding
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum