‎2007 Sep 14 8:50 AM
Hi Experts,
I've defined one parameter for company code(BUKRS) & one select option for valuation class (BWKEY) in my selection screen.
If I select any comp code in the parmeter, then in F4 help for valuation class should show only valuation class assigned to that comp code.
It can derived from table T001k .
Could anybody help in this issue?
Points for Sure.
Thanks,
Ponraj.s.
‎2007 Sep 14 9:00 AM
This can be done. It may be best if you have a bespoke search help for the valuation class. On this search help you can assign a parameter ID for the input field into the search help.
You will need to assign the value of BUKRS to this memory ID. However, when the BUKRS value is entered, the user will need to hit the enter key.
‎2007 Sep 14 8:55 AM
I think
that for this u have to go for the Module Pool Programming.
‎2007 Sep 14 9:00 AM
This can be done. It may be best if you have a bespoke search help for the valuation class. On this search help you can assign a parameter ID for the input field into the search help.
You will need to assign the value of BUKRS to this memory ID. However, when the BUKRS value is entered, the user will need to hit the enter key.
‎2007 Sep 14 9:09 AM
Hi,
Check the below code.
tables: t001k.
For Identification Number
DATA: BEGIN OF it_bwkey OCCURS 0,
bwkey LIKE t001k-bwkey,
END OF it_bwkey.
data: v_bukrs(4).
For Run date
DATA: BEGIN OF it_bukrs OCCURS 0,
bukrs LIKE t001k-bukrs,
END OF it_bukrs.
DATA it_ret LIKE ddshretval OCCURS 0 WITH HEADER LINE.
SELECTION-SCREEN: BEGIN OF BLOCK main WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP.
PARAMETERS: p_bukrs(4) TYPE c.
SELECT-OPTIONS s_bwkey FOR t001k-bwkey NO INTERVALS.
SELECTION-SCREEN END OF BLOCK main.
*----
Validation Section
*----
INITIALIZATION.
SELECT DISTINCT bukrs FROM t001k INTO TABLE it_bukrs.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bukrs.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'BUKRS'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'P_BUKRS'
value_org = 'S'
TABLES
value_tab = it_bukrs
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_bwkey-low.
TABLES: t130r.
DATA: BEGIN OF dynpfields OCCURS 0. "Hilfsstruktur zum auslesen des
INCLUDE STRUCTURE dynpread. "Feldwertes vom Dynpro bei >F4<
DATA: END OF dynpfields.
DATA : sy_repid LIKE sy-repid,
sy_dynnr LIKE sy-dynnr.
CLEAR dynpfields.
REFRESH dynpfields.
dynpfields-fieldname = 'P_BUKRS'.
APPEND dynpfields.
Lesen des akt. Wertes von Dynpro
sy_repid = sy-repid.
sy_dynnr = sy-dynnr.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy_repid
dynumb = sy_dynnr
TABLES
dynpfields = dynpfields
EXCEPTIONS
OTHERS = 01.
IF sy-subrc = 0.
READ TABLE dynpfields WITH KEY fieldname = 'P_BUKRS'.
IF sy-subrc = 0.
v_bukrs = dynpfields-fieldvalue.
ENDIF.
ENDIF.
SELECT bwkey FROM t001k
INTO TABLE it_bwkey
WHERE bukrs = v_bukrs.
DELETE ADJACENT DUPLICATES FROM it_bwkey.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'BWKEY'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'S_BWKEY'
value_org = 'S'
TABLES
value_tab = it_bwkey
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Message was edited by:
Velangini Showry Maria Kumar Bandanadham
‎2007 Sep 14 9:18 AM
‎2007 Sep 14 9:24 AM
Hi Ponraj,
I have updated my answer.
Use that code -- That will solve your requirement 100%.