2014 Aug 06 8:10 AM
I am creating a search help without selection method means all the values will come from search help exit i am attaching screen shot,my values are not going to output,
Please anyone heaving idea regarding this ...
**sample code**
TABLES
*" SHLP_TAB TYPE SHLP_DESCT
*" RECORD_TAB STRUCTURE SEAHLPRES
*" CHANGING
*" VALUE(SHLP) TYPE SHLP_DESCR
*" VALUE(CALLCONTROL) TYPE DDSHF4CTRL
*"----------------------------------------------------------------------
tables: /ain/dm_loct.
data : lt_loct type table of /ain/dm_loct,
wa_loct type /ain/dm_loct.
data lv_loc_guid type /AIN/DM_LOC_GUID.
data : lt_value type /AIN/PRF_ELEMENTVAL_TAB,
* lt_valuex type /AIN/PRF_ELEMENTVAL_TAB,
ls_value type /AIN/PRF_ELEMENTVAL_STR.
data : BEGIN OF ls_loc_gln.
include structure /AIN/PRF_ELEMENTVAL_STR.
data locdesc type /AIN/DM_LOCDESC.
data : END OF ls_loc_gln.
data lt_loc_gln like TABLE OF ls_loc_gln.
data lt_valuex like table of ls_loc_gln.
DATA: BEGIN OF ls_record.
INCLUDE STRUCTURE seahlpres.
DATA: END OF ls_record.
IF sy-subrc = 0.
ENDIF.
IF callcontrol-step = 'SELECT'.
ENDIF.
SELECT * from /ain/dm_loct into table lt_loct.
loop at lt_loct INTO wa_loct.
CALL FUNCTION '/AIN/UI_MAPPED_LOC_ID_GET'
EXPORTING
IV_LOC_GUID = wa_loct-loc_guid
IV_ID_TYPE = 'FMCG'
IMPORTING
* EV_ID_TYPE =
* EV_URN =
* EV_SGLN =
ET_VALUE = lt_value
* ET_RETURN =
.
READ TABLE lt_value into ls_value with key element = 'GLN'.
if sy-subrc = 0.
ls_loc_gln-element = ls_value-element.
ls_loc_gln-element_value = ls_value-element_value.
ls_loc_gln-locdesc = wa_loct-locdesc.
APPEND ls_loc_gln to lt_valuex.
endif.
REFRESH lt_value.
ENDLOOP.
refresh record_tab.
loop at lt_valuex into ls_loc_gln ."where element = 'GLN'.
CONCATENATE ls_loc_gln-locdesc
ls_loc_gln-element_value
into record_tab-string.
append record_tab.
ENDLOOP.
2014 Aug 06 12:07 PM
Hi Manisha,
Once you had got the rows to be displayed in the F4 help, you had to use the FM F4UT_RESULTS_MAP to append those rows to the F4 help. This will be called as shown in the following sample code:
CALL FUNCTION 'F4UT_RESULTS_MAP'
EXPORTING
apply_restrictions = 'X'
TABLES
shlp_tab = shlp_tab
record_tab = record_tab
source_tab = lt_purchgrp
CHANGING
shlp = shlp
callcontrol = callcontrol
EXCEPTIONS
illegal_structure = 1
OTHERS = 2.
IF sy-subrc <> 0.
EXIT.
ELSE.
callcontrol-step = 'DISP'.
ENDIF.
In the above sample code, the table lt_purchgrp contains the records to be shown in the F4 help. Try this. Your internal table lt_valuex had to be passed like this. This will work.
Regards,
Abijith
I am creating a search help without selection method means all the values will come from search help exit i am attaching screen shot,my values are not going to output,
Please anyone heaving idea regarding this ...
**sample code**
TABLES
*" SHLP_TAB TYPE SHLP_DESCT
*" RECORD_TAB STRUCTURE SEAHLPRES
*" CHANGING
*" VALUE(SHLP) TYPE SHLP_DESCR
*" VALUE(CALLCONTROL) TYPE DDSHF4CTRL
*"----------------------------------------------------------------------
tables: /ain/dm_loct.
data : lt_loct type table of /ain/dm_loct,
wa_loct type /ain/dm_loct.
data lv_loc_guid type /AIN/DM_LOC_GUID.
data : lt_value type /AIN/PRF_ELEMENTVAL_TAB,
* lt_valuex type /AIN/PRF_ELEMENTVAL_TAB,
ls_value type /AIN/PRF_ELEMENTVAL_STR.
data : BEGIN OF ls_loc_gln.
include structure /AIN/PRF_ELEMENTVAL_STR.
data locdesc type /AIN/DM_LOCDESC.
data : END OF ls_loc_gln.
data lt_loc_gln like TABLE OF ls_loc_gln.
data lt_valuex like table of ls_loc_gln.
DATA: BEGIN OF ls_record.
INCLUDE STRUCTURE seahlpres.
DATA: END OF ls_record.
IF sy-subrc = 0.
ENDIF.
IF callcontrol-step = 'SELECT'.
ENDIF.
SELECT * from /ain/dm_loct into table lt_loct.
loop at lt_loct INTO wa_loct.
CALL FUNCTION '/AIN/UI_MAPPED_LOC_ID_GET'
EXPORTING
IV_LOC_GUID = wa_loct-loc_guid
IV_ID_TYPE = 'FMCG'
IMPORTING
* EV_ID_TYPE =
* EV_URN =
* EV_SGLN =
ET_VALUE = lt_value
* ET_RETURN =
.
READ TABLE lt_value into ls_value with key element = 'GLN'.
if sy-subrc = 0.
ls_loc_gln-element = ls_value-element.
ls_loc_gln-element_value = ls_value-element_value.
ls_loc_gln-locdesc = wa_loct-locdesc.
APPEND ls_loc_gln to lt_valuex.
endif.
REFRESH lt_value.
ENDLOOP.
refresh record_tab.
loop at lt_valuex into ls_loc_gln ."where element = 'GLN'.
CONCATENATE ls_loc_gln-locdesc
ls_loc_gln-element_value
into record_tab-string.
append record_tab.
ENDLOOP.
2014 Aug 06 11:28 AM
Hi Manisha
First, are you sure there are data in /ain/dm_loct table? i appended data to 'lt_valuex' when i debugging your code, it display the F4.
Second, your main extract data process should in step 'DISP'.
IF callcontrol-step = 'DISP'.
select....
....
ENDIF.
As you know, there are 5 steps, no every step need this extract process, right?
1) SELONE - in this step FM 'DD_SHLP_GET_DIALOG_INFO' is called to populate the internal description of the fields for search help fields in table SHLP_TAB
2) PRESEL1 - in this step the maximum records, internal length, offset attributes of the fields are set
3) PRESEL - in this step a pop-up is displayed for the user to enter the selection criteria.
4) SELECT - in this step based on the selection criteria entered by the user data will be selected to RECORD_TAB internal table based on the selection method specified for the search help
5) DISP - this is the final step before the result list is displayed to the user.
regards,
Archer
2014 Aug 06 12:07 PM
Hi Manisha,
Once you had got the rows to be displayed in the F4 help, you had to use the FM F4UT_RESULTS_MAP to append those rows to the F4 help. This will be called as shown in the following sample code:
CALL FUNCTION 'F4UT_RESULTS_MAP'
EXPORTING
apply_restrictions = 'X'
TABLES
shlp_tab = shlp_tab
record_tab = record_tab
source_tab = lt_purchgrp
CHANGING
shlp = shlp
callcontrol = callcontrol
EXCEPTIONS
illegal_structure = 1
OTHERS = 2.
IF sy-subrc <> 0.
EXIT.
ELSE.
callcontrol-step = 'DISP'.
ENDIF.
In the above sample code, the table lt_purchgrp contains the records to be shown in the F4 help. Try this. Your internal table lt_valuex had to be passed like this. This will work.
Regards,
Abijith
2014 Aug 07 6:13 PM
thanks abijith,
but now i have one more issue after displaying message ,
suppose record_tab is initial .one pop_up comes restrict value range how to display that.
go through the attached image