Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Module Pool Programing POV (Process on Help Request) F4 Help Request

Former Member
0 Likes
3,291

Hi,

In a Custom Transaction (Module Pool Programming), I have MATNR, WERKS & BUKRS as screen input fields (Required Fields).

After the user populated the Material Field (This is using the collective search help attached to the screen filed), a F4 help to be implemented to bring plants that uses the just above populated Material. The F4 value request need to read plants that uses the Material and display in a table form (pop-up screen) for the user to choose the required plant. After choosing one plant from the pop-up screen by the user, that value needs to automatically to the WERKS screen field.

Once Plant is populated with right value, F4 help to be implemented to bring the company Codes that uses the above Plant. The F4 value request need to read Company Codes that uses the Plant and display in a table form (pop-up screen) for the user to choose the required Company Code. After choosing one Company Code from the pop-up screen by the user, that value needs to automatically to the BUKRS screen field.

I am trying to Build F4_Help_Modules in POV event. Can you please suggest me a suitable solution to accomplish this task?

Appreciate Your Help in Advance.

Thanks,

Kannan.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,351

In flow logic.

PROCESS ON VALUE-REQUEST.

FIELD matnr MODULE f4_matnr.

FIELD field2 MODULE f4_field2.

module f4_matnr.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'matnr' Value from popup window

DYNPPROG = SY-CPROG

DYNPNR = SY-DYNNR

DYNPROFIELD = 'matnr' value to screen field name

VALUE = ' '

VALUE_ORG = 'S'

TABLES

VALUE_TAB = f4 table value table.

endmodule.

If you want the value base on other field

declare this table and wa.

dynpro_values TYPE TABLE OF dynpread,

field_value LIKE LINE OF dynpro_values,

module f4_field2.

field_value-fieldname = 'matnr'.

APPEND field_value TO dynpro_values.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

DYNAME = SY-CPROG

DYNUMB = SY-DYNNR

TABLES

DYNPFIELDS = dynpro_values

READ TABLE dynpro_values INDEX 1 INTO field_value.

temp = field_value-fieldvalue.

SELECT * FROM table INTO TABLE itab WHERE matnr = temp.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'field2' Value from popup window

DYNPPROG = SY-CPROG

DYNPNR = SY-DYNNR

DYNPROFIELD = 'field2' value to screen field name

VALUE = ' '

VALUE_ORG = 'S'

TABLES

VALUE_TAB = itab value table.

endmodule.

Hope This will help you.

4 REPLIES 4
Read only

venkat_o
Active Contributor
0 Likes
1,351

Hi Kannan, You have 3 fields MATNR, WERKS & BUKRS. <li>Use POV event in flow logic. <li>Use <b>F4IF_INT_TABLE_VALUE_REQUEST</b> function module to get F4 help for MATNR.Select all Materials into one internal table and pass that to above function module. <li>For WERKS field use <b>DYNP_VALUES_READ</b> function module to read MATNR from selected value using F4. again use <b>F4IF_INT_TABLE_VALUE_REQUEST</b> fm to display f4 for WERKS field. <li>For BUKRS field , use <b>DYNP_VALUES_READ</b> function module to read WERKS from selected value using F4. again use <b>F4IF_INT_TABLE_VALUE_REQUEST</b> fm to display f4 for BUKRS field. <li> Go to SE37, use WHERE USED LIST search to know how those function modules are used in SAP system. I hope that it helps you. Thanks Venkat.O

Read only

Former Member
0 Likes
1,352

In flow logic.

PROCESS ON VALUE-REQUEST.

FIELD matnr MODULE f4_matnr.

FIELD field2 MODULE f4_field2.

module f4_matnr.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'matnr' Value from popup window

DYNPPROG = SY-CPROG

DYNPNR = SY-DYNNR

DYNPROFIELD = 'matnr' value to screen field name

VALUE = ' '

VALUE_ORG = 'S'

TABLES

VALUE_TAB = f4 table value table.

endmodule.

If you want the value base on other field

declare this table and wa.

dynpro_values TYPE TABLE OF dynpread,

field_value LIKE LINE OF dynpro_values,

module f4_field2.

field_value-fieldname = 'matnr'.

APPEND field_value TO dynpro_values.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

DYNAME = SY-CPROG

DYNUMB = SY-DYNNR

TABLES

DYNPFIELDS = dynpro_values

READ TABLE dynpro_values INDEX 1 INTO field_value.

temp = field_value-fieldvalue.

SELECT * FROM table INTO TABLE itab WHERE matnr = temp.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'field2' Value from popup window

DYNPPROG = SY-CPROG

DYNPNR = SY-DYNNR

DYNPROFIELD = 'field2' value to screen field name

VALUE = ' '

VALUE_ORG = 'S'

TABLES

VALUE_TAB = itab value table.

endmodule.

Hope This will help you.

Read only

Former Member
0 Likes
1,351

Hi Kannan SA ,

Have you got the answer?

If Not , what problem you got let me know to Help.

Pramoth CG

Read only

0 Likes
1,351

Hi..

Thanks a lot for your help