2011 Jan 13 10:28 AM
Hi Experts,
In the selection scrren I want an F4 Help for a certain field.
The help popup is coming with message @ status bar '11 records found'.
But the the values are not getting displayed in the popup.
<< Moderator message - Everyone's problem is important. But the answers in the forum are provided by volunteers. Please do not ask for help quickly. >>
Code snippet:
types: begin of x_cag_help,
cag(4) type c,
end of x_cag_help.
data: wa_cag_help type x_cag_help,
it_cag_help type table of x_cag_help.
FORM cag_f4_help . PERFORM create_cag_tab.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CAG'
dynprofield = 'P_CAG'
value_org = 'S'
TABLES
value_tab = it_cag_help
return_tab = it_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
p_cag = it_return-fieldval.
ENDFORM. " CAG_F4_HELP
FORM create_cag_tab . REFRESH: it_cag_help[].
wa_cag_help-cag = 'ZCNI'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZRES'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZMUL'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZMFA'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZRSI'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNRL'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNRS'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNRV'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNR4'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNR5'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZRS2'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
ENDFORM. " CREATE_CAG_TAB
Best regards,
Anirban.
Edited by: Rob Burbank on Jan 13, 2011 4:19 PM
2011 Jan 13 11:14 AM
Dear Anirban,
Your problem will be solved like this...
Change the type of field CAG into structure x_cag_help from
cag(4) type c,
to
cag TYPE char4,
Insert the following lines before the event INITIALIZATION.
*---------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_cag.
*---------------------------------------------------------------------*
PERFORM cag_f4_help.
In the FM, add the EXPORT parameters
dynpprog = sy-repid
dynpnr = sy-dynnr
Finally, comment the line
* p_cag = it_return-fieldval.
Your code should be like this in the end...
PARAMETERS: p_cag TYPE char4.
TYPES: BEGIN OF x_cag_help,
cag TYPE char4,
END OF x_cag_help.
DATA: wa_cag_help TYPE x_cag_help,
it_cag_help TYPE TABLE OF x_cag_help WITH HEADER LINE.
*---------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_cag.
*---------------------------------------------------------------------*
PERFORM cag_f4_help.
*&---------------------------------------------------------------------*
*& Form cag_f4_help
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM cag_f4_help .
PERFORM create_cag_tab.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CAG'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'P_CAG'
value_org = 'S'
TABLES
value_tab = it_cag_help
* return_tab = it_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
* p_cag = it_return-fieldval.
ENDFORM. " CAG_F4_HELP
*&---------------------------------------------------------------------*
*& Form create_cag_tab
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM create_cag_tab .
REFRESH: it_cag_help[].
wa_cag_help-cag = 'ZCNI'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZRES'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZMUL'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZMFA'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZRSI'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNRL'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNRS'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNRV'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNR4'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNR5'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZRS2'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
ENDFORM. " CREATE_CAG_TAB
Edited by: João Henrique Luz Alves de Araujo on Jan 13, 2011 9:16 AM
Hi Experts,
In the selection scrren I want an F4 Help for a certain field.
The help popup is coming with message @ status bar '11 records found'.
But the the values are not getting displayed in the popup.
<< Moderator message - Everyone's problem is important. But the answers in the forum are provided by volunteers. Please do not ask for help quickly. >>
Code snippet:
types: begin of x_cag_help,
cag(4) type c,
end of x_cag_help.
data: wa_cag_help type x_cag_help,
it_cag_help type table of x_cag_help.
FORM cag_f4_help . PERFORM create_cag_tab.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CAG'
dynprofield = 'P_CAG'
value_org = 'S'
TABLES
value_tab = it_cag_help
return_tab = it_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
p_cag = it_return-fieldval.
ENDFORM. " CAG_F4_HELP
FORM create_cag_tab . REFRESH: it_cag_help[].
wa_cag_help-cag = 'ZCNI'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZRES'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZMUL'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZMFA'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZRSI'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNRL'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNRS'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNRV'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNR4'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNR5'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZRS2'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
ENDFORM. " CREATE_CAG_TAB
Best regards,
Anirban.
Edited by: Rob Burbank on Jan 13, 2011 4:19 PM
2011 Jan 13 10:37 AM
Hi Try this way...
types: begin of x_cag_help,
cag(4) type c,
end of x_cag_help.
*FORM cag_f4_help .* PERFORM create_cag_tab.
data: wa_cag_help type x_cag_help,
it_cag_help type table of x_cag_help.
wa_cag_help-cag = 'ZCNI'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZRES'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZMUL'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZMFA'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZRSI'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNRL'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNRS'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNRV'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNR4'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNR5'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZRS2'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CAG'
dynpprog = sy-repid
dynpnr = '1000'
dynprofield = 'P_CAG'
value_org = 'S'
TABLES
value_tab = it_cag_help
return_tab = it_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
* p_cag = it_return-fieldval. "comment this
ENDFORM. " CAG_F4_HELP
Prabhudas
2011 Jan 13 10:43 AM
What about
dynpprog = sy-repid
dynpnr = sy-dynnr
ALso you cannot pass like this
p_cag = it_return-fieldval.
2011 Jan 13 10:43 AM
Hello Anirban,
Pass the
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNRto the FM and check.
BR,
Suhas
2011 Jan 13 10:56 AM
Sample logic.
DATA: gret_tab5 TYPE STANDARD TABLE OF ddshretval ,
gf_tab5 TYPE ddshretval.
TYPES :
BEGIN OF ty_ekwsl,
ekwsl TYPE t405-ekwsl,
mahn1 TYPE t405-mahn1,
mahn2 TYPE t405-mahn2,
mahn3 TYPE t405-mahn3,
untto TYPE t405-untto,
uebto TYPE t405-uebto,
uebtk TYPE t405-uebtk,
evers TYPE t405-evers,
kzabs TYPE t405-kzabs,
weprz TYPE t405-weprz,
welfz TYPE t405-welfz,
END OF ty_ekwsl.
DATA: it_ekwsl TYPE STANDARD TABLE OF ty_ekwsl ,
gf_ekwsl TYPE ty_ekwsl.
SELECT * FROM t405
INTO CORRESPONDING FIELDS OF TABLE it_ekwsl.
IF it_ekwsl IS NOT INITIAL.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'EKWSL'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'GS_FORM-EKWSL'
value_org = 'S'
TABLES
value_tab = it_ekwsl
return_tab = gret_tab5
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc eq 0.
READ TABLE gret_tab5 INTO gf_tab5 INDEX 1.
gs_form-ekwsl= gf_tab5-fieldval.
ENDIF.
ENDIF.
2011 Jan 13 11:14 AM
Dear Anirban,
Your problem will be solved like this...
Change the type of field CAG into structure x_cag_help from
cag(4) type c,
to
cag TYPE char4,
Insert the following lines before the event INITIALIZATION.
*---------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_cag.
*---------------------------------------------------------------------*
PERFORM cag_f4_help.
In the FM, add the EXPORT parameters
dynpprog = sy-repid
dynpnr = sy-dynnr
Finally, comment the line
* p_cag = it_return-fieldval.
Your code should be like this in the end...
PARAMETERS: p_cag TYPE char4.
TYPES: BEGIN OF x_cag_help,
cag TYPE char4,
END OF x_cag_help.
DATA: wa_cag_help TYPE x_cag_help,
it_cag_help TYPE TABLE OF x_cag_help WITH HEADER LINE.
*---------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_cag.
*---------------------------------------------------------------------*
PERFORM cag_f4_help.
*&---------------------------------------------------------------------*
*& Form cag_f4_help
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM cag_f4_help .
PERFORM create_cag_tab.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CAG'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'P_CAG'
value_org = 'S'
TABLES
value_tab = it_cag_help
* return_tab = it_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
* p_cag = it_return-fieldval.
ENDFORM. " CAG_F4_HELP
*&---------------------------------------------------------------------*
*& Form create_cag_tab
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM create_cag_tab .
REFRESH: it_cag_help[].
wa_cag_help-cag = 'ZCNI'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZRES'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZMUL'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZMFA'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZRSI'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNRL'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNRS'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNRV'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNR4'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZNR5'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
wa_cag_help-cag = 'ZRS2'.
APPEND wa_cag_help TO it_cag_help.
CLEAR wa_cag_help.
ENDFORM. " CREATE_CAG_TAB
Edited by: João Henrique Luz Alves de Araujo on Jan 13, 2011 9:16 AM
2011 Jan 13 12:08 PM
Hi,
Iif you do the type declaration like Cag(4) type c you will get the values in the internal table .But it will not gets displayed.
So cag must be declared with the correct table field like cag type t001-werks.
Then it will display the Values in the internal table.
Hope this might helps you to solve your problem.
With Regards,
Sumodh.P
2011 Jan 14 6:00 AM
Thank you all for your prompt valuable replies.
Only change that was required was:
Previously I declared:
cag(4) type c.
Changed as:
cag type char4.
Problem solved.
Points given.
Thanks.
Anirban.
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |