Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
1,162

High level requirement : Whenever MM RFQ created the line item material column should me mandatory based on Doc. Type and Purchase Organization.

Possible Solution : In SPRO customizing, define screen layout level we can set whether Reqd.entry / Opt. entry /  Display.

Analysis :

1)  In selection group basic item data we couldnt find Material field so its controlled by program level.

"Field Label                    Reqd.entry  Opt. entry  Display

Plant

Storage location

Indicator: "Texts exist"

Short text

Material group

Material description

Manufacturer part number"

2) Tried to put validation on enhancement 'MM06E005' with PAI and Posting level but validation got triggered and stopping the entire process. Say like I have maintained 20 rows in table control with material column and 21st row i have maintained material text, in this case validation triggered but I couldnt delete since the error got triggered. Now there is an option to create from scratch RFQ from beginning which is redundant work.

3) Tried BADI but not suitable.

4) Tried field exit(EMATNR) based on Doc. Type and Purchase Organization. But the problem is when I maintain complete line items and validated successfully as our need but the field exit code got triggered on next row which is empty. I have tried to compare the Short Text field value but the value will be assigned to variable once field exit fired.

Again I have created one more field exit on the data element 'TXZ01' and made small logic which is given below.

Both field exit FM's(FIELD_EXIT_EMATNR and FIELD_EXIT_TXZ01) are grouped into one Function Group(ZFG_ME41)

declared global variable as data gs_flag.

Below the logic written inside FM-FIELD_EXIT_TXZ01

  IF SY-TCODE EQ 'ME41' or SY-TCODE EQ 'ME42'.

       if gs_flag is not initial and input is not initial.

         message 'Please enter material code' type 'E'.

       endif.

       clear gs_flag.

  ENDIF.

Below the logic written inside FM-FIELD_EXIT_EMATNR

  IF SY-TCODE EQ 'ME41' or SY-TCODE EQ 'ME42'.

       if input is initial.

          gs_flag = 'X'.

       else.

          clear gs_flag.

       endif.

  ENDIF.

Now I have tested both ME41/ME42 and its working as expected.

This blog is very simple but I spent lot of time to achieve this validation and I can say 'everything is possible'.

Please post your valuable comments and thanks for your valuable time.

Regards,

Vadamalai A,

Technical Architect-Tech Mahindra.

2 Comments
Labels in this area