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

F4 Help in Table Maintenance Generator

Former Member
0 Likes
10,345

Hi,

There is a custom table and it's Table Maintenance Generator is done.while maintaining entries from SM30 need F4 help on Field2 and Field3 based on value selected of Field1.

Say it has 4 fields, the requirement is on select of some value on Field1 need to populate the F4 helpl values for field2 and Field3.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
5,636

Hi,

Please refer to search helps attached to fields VKORG, VTWEG and SPART in table VBAK. Try implementing the same way.

When you display contents of table VBAK, first select VKORG value and then do a F4 on VTWEG, you will see the behavior as per your requirement.

Thanks,

Hi,

There is a custom table and it's Table Maintenance Generator is done.while maintaining entries from SM30 need F4 help on Field2 and Field3 based on value selected of Field1.

Say it has 4 fields, the requirement is on select of some value on Field1 need to populate the F4 helpl values for field2 and Field3.

6 REPLIES 6
Read only

Former Member
0 Likes
5,637

Hi,

Please refer to search helps attached to fields VKORG, VTWEG and SPART in table VBAK. Try implementing the same way.

When you display contents of table VBAK, first select VKORG value and then do a F4 on VTWEG, you will see the behavior as per your requirement.

Thanks,

Read only

0 Likes
5,636

ok But my logic to get f4 help values is not straight forward as mentioned below.

  • Custom table ZCUST and fields VBELN(Contract no), POSNR (Invoice item) and MATNR (Invoice matnr).
  • On press of F4 on POSNR.Get the data from VBAK based on Contract no ZCUST-VBELN.
  • Go to VBFA pass ZCUST-VBELN and get Deliveries and Invoices. J-Deliveries and M-Invoices.
  • Need to consider Invoices which are from Deliveries only.
  • So again Go to VBFA and get Invoices with respect to Deliveries (Which got in above step).
  • Finally Go to VBRP and get POSNR and MATNR. The same needs to be shown in F4 help.



So I tried creating event 'Process on Value Request on  POSNR' in PAI of table maintenance generator program and called FM 'F4IF_INT_TABLE_VALUE_REQUEST' to fill F4 values  and 'DYNP_VALUES_READ' to read contract no from screen. I am able to display hard coded value in F4 of POSNR but facing only one issue.

'DYNP_VALUES_READ' not giving contract no entered on screen and also we need to pass dynpro name to this FM  dyname. syst-cprog holds some other name but not screen name of table maintenace generator. even if we hard code screen name it doesn't give contract no in result.

If I am able to get contract no using 'DYNP_VALUES_READ' or some other FM then I could solve problem.

Mean while I will check if I can implement logic as there in VKORG,VTWEG .

Read only

0 Likes
5,636

You must pass the current table control line to DYNP_VALUES_READ (field STEPL). SY-STEPL. For program and dynpro number, use SY-REPID (SY-CPROG has often the same value, but is technically incorrect in the context of getting the current dynpro program) and SY-DYNNR for the dynpro number.

Personally, I'd prefer to place the coding in a new custom search help, that would avoid the risk of losing the modifications at the next dialog maintenance generation (if not done carefully/Murphy's law), and from my point of view it simplifies the transfer of field values in and out.

Read only

0 Likes
5,636

SY-STEPL is always zero. I just changed in debugging to 1 and it worked. why sy-stepl is not getting updated, not sure?

Also, As you are suggesting to place the code in new custom search help. I already mention the logic, so based on it could you please provide some sample to achieve the requirement.I want to try this option also.

Read only

0 Likes
5,636

Sorry, it's not SY-STEPL (it works only inside the LOOP of the PBO/PAI). For POV, you have to call function module DYNP_GET_STEPL to retrieve the current line.

Read only

0 Likes
5,636

The search help must have input fields VBELN, POSNR, MATNR, and output field POSNR. You'll also have to select the fields you want to display in the F4 result list.

Define a search help exit function module. In this function module, add your code. You'll have to call F4UT_RESULTS_MAP to return the values for the F4 result list.

You have to assign the search help to the field POSNR of ZCUST, and link the input/output fields.

Search SAP library and forum for more info.