‎2010 Dec 01 10:31 AM
Hi all,
I am working on dialog programming where i need GL description in a input field.
Requirement is that user will get list of GL code with GL description on the basis of company code and when he will select any GL those GL description will appear on input field.
i am try to use collective search help....
since in table SKAT, GL and GL description is there but not on the basis of company code.
so i am using SKB1 where i am getting GL with company code.
but collective search help export only key field SAKNR(GL CODE) as a return on input field.
so please suggest me what should i do to get non key field(text filed) populated in input screen.
Thanks and Regards
Vijay dwivedi
‎2010 Dec 01 11:38 AM
Hi
Copy that search help into Z search help. Modify it to add the GL Description to appear in the popup and also set it as return value.
Regards
Raj
‎2010 Dec 01 11:44 AM
Hi
u can excute below code and we can select company code that related company code g/l displays in second f4 help
REPORT ZMRL_MODULE_POOL.
TYPES:bEGIN OF TY_SKB1,
BUKRS TYPE BUKRS,
saknr type saknr,
END OF TY_SKB1.
DATA:WA TYPE TY_SKB1,
ITAB TYPE STANDARD TABLE OF TY_SKB1.
DATA:ITAB_SAKNR TYPE STANDARD TABLE OF TY_SKB1.
TYPES:bEGIN OF TY_SKAT,
SAKNR TYPE SAKNR,
TXT20 TYPE STRING,
END OF TY_SKat.
DATA:WA_SKAT TYPE TY_SKAT,
ITAB_SKAT TYPE STANDARD TABLE OF TY_SKAT.
START-OF-SELECTION.
CALL SCREEN 100.
MODULE F4_BUKRS INPUT.
SELECT BUKRS FROM SKB1 INTO TABLE ITAB UP TO 10 ROWS.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'BUKRS'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'WA-BUKRS'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = ITAB
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING =
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.
ENDMODULE. " F4_BUKRS INPUT
&----
*& Module F4_SAKNR INPUT
&----
text
----
MODULE F4_SAKNR INPUT.
DATA:V_TEMP TYPE STRING.
DATA: BEGIN OF DFIELD OCCURS 0.
INCLUDE STRUCTURE DYNPREAD.
DATA: END OF DFIELD.
MOVE: 'WA-BUKRS' TO DFIELD.
APPEND DFIELD.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = SY-REPID
dynumb = SY-DYNNR
tables
dynpfields = DFIELD.
READ TABLE DFIELD[] INTO DFIELD INDEX 1.
V_TEMP = DFIELD-FIELDVALUE.
SELECT SAKNR FROM SKB1 INTO TABLE ITAB_SAKNR WHERE BUKRS = V_TEMP.
IF NOT ITAB_SAKNR IS INITIAL.
SELECT SAKNR TXT20 FROM SKAT INTO TABLE ITAB_SKAT FOR ALL ENTRIES IN ITAB_SAKNR WHERE SAKNR = ITAB_SAKNR-SAKNR AND
SPRAS = 'EN'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'SAKNR'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'WA_SKAT-SAKNR'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = ITAB_SKAT
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING =
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.
ENDIF.
ENDMODULE. " F4_SAKNR INPUT
regards,
muralii
Edited by: Muralii on Dec 1, 2010 12:53 PM
Edited by: Muralii on Dec 1, 2010 12:54 PM
‎2010 Dec 01 11:57 AM
Hi Muralii,
Your way is right but i don't want to put code for input help, i want to use collective search help.....my last hope is input help.
i have created search help but it is not returning text field, reason behind is that it is non key or non ref key well. Is there any other way to get non ref key as a return value.
Thanks for your eagerness to reply
Regards
Vijay dwivedi
‎2010 Dec 01 12:03 PM
Hi vijay,
First we need to create the input field on layout the u can double click on the input field then below we can give the COLLECTIVE SEARCH HELP name but that input fieldn name WA-SKAT-SAKNR.
Regards,
Muralii