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

Parameter search help

Former Member
0 Likes
1,586

How can I create a parameter on the selection screen for lifnr that will allow the user to search for the correct vendor and then display the vendor name on the screen when a vendor is chosen?

Should I use search help or value-request or a combination?

Any examples would be very appreciated.

Thanks,

Janet

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,484

Hi Janet,

Please try this.


REPORT ZTEST.
                                                                        
PARAMETER: P_LIFNR LIKE LFA1-LIFNR,
           P_NAME1 LIKE LFA1-NAME1.
                                                                        
AT SELECTION-SCREEN.
IF NOT P_LIFNR IS INITIAL.
  SELECT SINGLE NAME1
  INTO P_NAME1
  FROM LFA1
  WHERE LIFNR = P_LIFNR.
ENDIF.

Regards,

Ferry Lianto

12 REPLIES 12
Read only

Former Member
0 Likes
1,484

hi janet,

use the FM F4IF_INT_TABLE_VALUE_REQUEST

Regards,

priya.

Read only

0 Likes
1,484

Priya,

This will not display the vendor name, correct? I will need the code from Ferry to display the name.

Read only

Former Member
0 Likes
1,484

Hi Janet,

You don't need to create any search helps explicitly.

Follow these steps.

parameters: P_lifnr for lfa1-lifnr.

But it would only display the Number.

If you want to display the Description of that LIFNR, then you need to press enter to get the description.

at selection-screen.

select single name1 from lfa1intp p_descr where lifnr = p_lifnr.

REgards,

Ravi

Read only

0 Likes
1,484

Ater F4 the program doesnt come to PBO so you nedd to intercept the screen flow.

Use FM F4IF_INT_TABLE_VALUE_REQUEST in AT SELECTION-SCREEN ON REQUEST to use the standard help, then select from database the data you need and put in on screen via FM DYNP_VALUES_UPDATE.

Dont forget to put the output field as no-input via a LOOP AT SCREEN in your AT SELECTION-SCREEN OUTPUT.

Regards.

Read only

0 Likes
1,484

I found an example i looked at sometime ago

Regards

Read only

Former Member
0 Likes
1,485

Hi Janet,

Please try this.


REPORT ZTEST.
                                                                        
PARAMETER: P_LIFNR LIKE LFA1-LIFNR,
           P_NAME1 LIKE LFA1-NAME1.
                                                                        
AT SELECTION-SCREEN.
IF NOT P_LIFNR IS INITIAL.
  SELECT SINGLE NAME1
  INTO P_NAME1
  FROM LFA1
  WHERE LIFNR = P_LIFNR.
ENDIF.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
1,484

Hi Janet,

You do not need to use search help and FM.

If you reference the parameter field to LFA1-LIFNR, there is already search KRED_C provided in table LFA1. And you just simply populate the vendor name by reading table LFA1 AT SELECTION-SCREEN. See above sample code.

Regards,

Ferry Lianto

Read only

0 Likes
1,484

Thanks. This is great.

I am having a problem that my program is not hitting the AT selection-screen. Any ideas?

selection-screen end of block invoice.

parameter: p_lifnr like lfa1-lifnr,

p_name like lfa1-name1.

*Initialize variables

initialization.

set pf-status 'MAIN'.

at selection-screen.

IF NOT P_LIFNR IS INITIAL.

SELECT SINGLE NAME1

INTO P_NAME

FROM LFA1

WHERE LIFNR = P_LIFNR.

ENDIF.

start-of-selection.

Read only

0 Likes
1,484

Why is this used?

<b>initialization.

set pf-status 'MAIN'.</b>

This is the cause for your problem of st selection-screen not being triggered.

regards,

ravi

Read only

Former Member
0 Likes
1,484

Hi Janet,

It works for me and you need to press enter after selecting vendor name in order to see vendor name appear in parameter screen.

Please do debugging and see where the error is occured.

Regards,

Ferry Lianto

Read only

0 Likes
1,484

I think there is a conflict with required parameters on the screen. It will only go to the at selection screen after all the obligatory fields are entered.

Does that make sense to you?

Read only

0 Likes
1,484

Hi Ferry,

Yes, that is what it is doing. It requires input into the required fields (which are below the vendor number) before it hits the 'at selection screen'. This makes it very awkward. I need to think of a work around.

Any ideas?