‎2007 Mar 16 2:41 PM
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
‎2007 Mar 16 2:54 PM
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
‎2007 Mar 16 2:44 PM
hi janet,
use the FM F4IF_INT_TABLE_VALUE_REQUEST
Regards,
priya.
‎2007 Mar 16 3:00 PM
Priya,
This will not display the vendor name, correct? I will need the code from Ferry to display the name.
‎2007 Mar 16 2:46 PM
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
‎2007 Mar 16 3:01 PM
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.
‎2007 Mar 16 3:04 PM
‎2007 Mar 16 2:54 PM
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
‎2007 Mar 16 3:11 PM
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
‎2007 Mar 16 3:23 PM
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.
‎2007 Mar 16 3:26 PM
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
‎2007 Mar 16 3:29 PM
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
‎2007 Mar 16 3:34 PM
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?
‎2007 Mar 16 3:38 PM
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?