2009 Jan 24 12:55 PM
Hello,
could you pls let us know how to make mandatory fields in Header data for "Forwarding agent" and "Truck number" while creating STO in IS oil senarios.
thanks,
SapNA
2009 Jan 29 10:25 AM
You have add coding in include ZXM06U43 of user exit EXIT_SAPMM06E_012 of project MM06E005 in cmod.
code attached
***Material Code Mandatory with Acct Assignment Q-End.
***To disallow PO without GR Indicator for document type other than HR
if i_ekko-bsart = 'UB' and i_ekko-oic_mot = space .
message e000(zmm) with 'Fill the Mode of Transport in Header Section'.
endif.
if i_ekko-bsart = 'UB' and i_ekko-oic_mot = 5 and ( i_ekko-oic_ptrip = space OR i_ekko-oic_pbatch = space ) .
message e000(zmm) with 'Enter Pipe Line,Batch and Trip Number in Header Section'.
endif.
*---item level check start-----
if i_ekko-bsart = 'UB' and ( i_ekko-oic_mot = 5 or i_ekko-oic_mot = 1 oR i_ekko-oic_mot = 2 ) .
read table tekpo index 1.
read table tekpo with key oic_mot = space .
if sy-subrc = 0.
message e000(zmm) with 'Enter Item Mode of Transport' .
endif.
endif.
if i_ekko-bsart = 'UB' and i_ekko-oic_mot = 5 .
read table tekpo index 1.
read table tekpo with key oic_mot = 5 .
if sy-subrc = 0.
else.
message e000(zmm) with 'Enter Item Mode of Transport as 5' .
endif.
endif.
if i_ekko-bsart = 'UB' and i_ekko-oic_mot = 2 .
read table tekpo index 1.
read table tekpo with key oic_mot = 2 .
if sy-subrc = 0.
else.
message e000(zmm) with 'Enter Item Mode of Transport as 2' .
endif.
endif.
if i_ekko-bsart = 'UB' and i_ekko-oic_mot = 1 .
read table tekpo index 1.
read table tekpo with key oic_mot = 1 .
if sy-subrc = 0.
else.
message e000(zmm) with 'Enter Item Mode of Transport as 1' .
endif.
endif.
if i_ekko-bsart = 'UB' and i_ekko-oic_mot = 5.
read table tekpo index 1.
if tekpo-oic_ptrip = space or tekpo-oic_pbatch = space.
message e000(zmm) with 'Enter Pipe Line,Batch and Trip Number in Item Section'.
endif.
endif.
if i_ekko-bsart = 'UB' .
read table tekpo index 1.
if ( tekpo-oiumbar ne 'OWN-BOND' or tekpo-oiumbar ne 'OWN-BONDBR' ) and tekpo-bwtar = space .
if tekpo-matnr ne 'MTBE01'.
message e000(zmm) with 'Enter VAL Type of supplying and receiving plant in Item Section'.
endif.
endif.
regards
Dipak
2009 Jan 29 10:25 AM
You have add coding in include ZXM06U43 of user exit EXIT_SAPMM06E_012 of project MM06E005 in cmod.
code attached
***Material Code Mandatory with Acct Assignment Q-End.
***To disallow PO without GR Indicator for document type other than HR
if i_ekko-bsart = 'UB' and i_ekko-oic_mot = space .
message e000(zmm) with 'Fill the Mode of Transport in Header Section'.
endif.
if i_ekko-bsart = 'UB' and i_ekko-oic_mot = 5 and ( i_ekko-oic_ptrip = space OR i_ekko-oic_pbatch = space ) .
message e000(zmm) with 'Enter Pipe Line,Batch and Trip Number in Header Section'.
endif.
*---item level check start-----
if i_ekko-bsart = 'UB' and ( i_ekko-oic_mot = 5 or i_ekko-oic_mot = 1 oR i_ekko-oic_mot = 2 ) .
read table tekpo index 1.
read table tekpo with key oic_mot = space .
if sy-subrc = 0.
message e000(zmm) with 'Enter Item Mode of Transport' .
endif.
endif.
if i_ekko-bsart = 'UB' and i_ekko-oic_mot = 5 .
read table tekpo index 1.
read table tekpo with key oic_mot = 5 .
if sy-subrc = 0.
else.
message e000(zmm) with 'Enter Item Mode of Transport as 5' .
endif.
endif.
if i_ekko-bsart = 'UB' and i_ekko-oic_mot = 2 .
read table tekpo index 1.
read table tekpo with key oic_mot = 2 .
if sy-subrc = 0.
else.
message e000(zmm) with 'Enter Item Mode of Transport as 2' .
endif.
endif.
if i_ekko-bsart = 'UB' and i_ekko-oic_mot = 1 .
read table tekpo index 1.
read table tekpo with key oic_mot = 1 .
if sy-subrc = 0.
else.
message e000(zmm) with 'Enter Item Mode of Transport as 1' .
endif.
endif.
if i_ekko-bsart = 'UB' and i_ekko-oic_mot = 5.
read table tekpo index 1.
if tekpo-oic_ptrip = space or tekpo-oic_pbatch = space.
message e000(zmm) with 'Enter Pipe Line,Batch and Trip Number in Item Section'.
endif.
endif.
if i_ekko-bsart = 'UB' .
read table tekpo index 1.
if ( tekpo-oiumbar ne 'OWN-BOND' or tekpo-oiumbar ne 'OWN-BONDBR' ) and tekpo-bwtar = space .
if tekpo-matnr ne 'MTBE01'.
message e000(zmm) with 'Enter VAL Type of supplying and receiving plant in Item Section'.
endif.
endif.
regards
Dipak
2009 Mar 08 6:58 PM
2009 Feb 06 11:53 AM
Hi Raj,
IS Oil STO Senerio the fields Forwarding agent and truck no are availabe at Item level in External details tab, you have to write piece of codeing using this exit EXIT_SAPMM06E_012 in such as way that while checking and save the PO it should pop up message for the fields as mandatory.
1. OIC_LIFNR (Forwarding Agent).
2. OIC_TRUCKN (Truck number).
So that user can enter these fields, before saving the document.
Best Regards
Satish
2009 Mar 03 7:29 PM
Hi,
In your configuration for your STO document type, check the screen layout assigned to it, There, you should be able to see the fields relevant for STO (which includes the truck number. On the screen, you can flag which fields are mandatory fields.
zccr