03-22-2008 6:07 AM
Hi Gurus,
I am implementing F4 help manually through above function module in which i am displaying internal table containing two value fields list and version.
Now i want both the column values in return table.
Can you please assist how to get both column values in return table.
Regards
Ashutosh
03-22-2008 6:13 AM
Check out this sample code
data:
begin of t_values occurs 2,
value like kna1-begru,
end of t_values,
t_return like ddshretval occurs 0 with header line.
t_values = 'PAR*'.
append t_values.
t_values = 'UGG'.
append t_values.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'BEGRU'
value_org = 'S'
tables
value_tab = t_values
return_tab = t_return
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
if sy-subrc = 0.
read table t_return index 1.
o_begru-low = t_return-fieldval.
if o_begru-low = 'PAR*'.
o_begru-option = 'CP'.
else.
o_begru-option = 'EQ'.
endif.
o_begru-sign = 'I'.
append o_begru to s_begru.
else.
o_begru = i_begru.
endif.
03-22-2008 6:22 AM
Hi,
Thanks for your reply.
But my problem is something different.
In my value tab there are two fields which i am displaying in value request.
i,.e two different columns in output window and when i select any line i want both the column values in return table.
How can we achieve this,
Thanks & regards
Ashutosh
03-22-2008 6:24 AM
Hi,
Check the Following code,
DATA : BEGIN OF I_GRPMAST OCCURS 0,
GRPCODE LIKE ZGLGRPDEF-GRPCODE,
GRPDESC LIKE ZGLGRPDEF-GRPDESC,
END OF I_GRPMAST.
SELECT * FROM ZGLGRPDEF INTO CORRESPONDING FIELDS OF TABLE I_GRPMAST.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'GRPCODE'
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'I_GLMAST-GRPCODE'
WINDOW_TITLE = 'List of parent group code'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = I_GRPMAST.
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
in the intrnal table I_GRPMAST has 2 fields u will get
u will get two fields in the POPUP.
Regards,
Balakumar.G.
Reward Points if helpful.
03-22-2008 6:39 AM
Hi,
Yes that right that we get two columns in output pop up window but when you select any record you only get first colunn record which u specified in retfeild field of FM
I want both the fields from popup into return table of FM.
Regards,
Ashutosh
03-22-2008 7:03 AM
Hi
see this sample code you can understand very easily
tables : HRp1001.
TYPES : BEGIN OF ST_OBJID_SH,
OTYPE TYPE HRP1000-OTYPE,
OBJID TYPE HRP1000-OBJID,
END OF ST_OBJID_SH.
DATA : IT_OBJID_SH TYPE STANDARD TABLE OF ST_OBJID_SH.
DATA : WA_OBJID_SH TYPE ST_OBJID_SH.
************SELECTION SCREEN DESIGN************************
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
*SELECT-OPTIONS : S_OTYPE FOR HRP1001-OTYPE NO INTERVALS .
SELECT-OPTIONS : S_OBJID FOR HRP1001-OBJID NO INTERVALS .
SELECT-OPTIONS : DATE FOR SY-DATUM NO-EXTENSION OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1.
***********END OF SELECTION SCREEN DESIGN******************
**********VALIDATION FOR SCREEN FIELDS*********************
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_OBJID-LOW.
IF S_OBJID IS NOT INITIAL.
SELECT OTYPE OBJID FROM HRP1000
INTO TABLE IT_OBJID_SH
WHERE OTYPE = 'D'.
IF SY-SUBRC EQ 0.
SEARCH HELP FOR QUALIFICATION.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'OBJID'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'S_OBJID'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = IT_OBJID_SH
FIELD_TAB =
RETURN_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.
Regards,
Chandru