SAP for Oil, Gas, and Energy Discussions
Connect with fellow SAP users to share best practices, troubleshoot challenges, and navigate the evolving energy landscape. Join the conversation today!
cancel
Showing results for 
Search instead for 
Did you mean: 

Truck number

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

View solution in original post

4 REPLIES 4

Former Member
0 Kudos

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

0 Kudos

thanks Dipak i have managed with abap consultant.

Former Member
0 Kudos

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

Former Member
0 Kudos

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