Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV grid

Former Member
0 Likes
1,035

Hi,

These are my requirements.

  • I have designed a ALV grid which has the fields BEGDA and ENDDA. i require a calendar on f4.

*I require a dropdown box for a field.

  • I require a search help for a field.

  • On saving any new entries, it has to get updated in the HRP1001.

Kindly help me on these queries.

1 ACCEPTED SOLUTION
Read only

former_member156446
Active Contributor
0 Likes
999

to get the calender declare the parameters like sy-datum

parameters: pa_begdat type sy-datum.

drop down box:



Check the following code:
TYPE-POOLS: VRM.

DATA: NAME TYPE VRM_ID,
LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST.

PARAMETERS: PS_PARM(10) AS LISTBOX VISIBLE LENGTH 10.

AT SELECTION-SCREEN OUTPUT.

NAME = 'PS_PARM'.
VALUE-KEY = '1'.

VALUE-TEXT = 'LINE 1'.
APPEND VALUE TO LIST. VALUE-KEY = '2'.

VALUE-TEXT = 'LINE 2'.
APPEND VALUE TO LIST.

CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.

START-OF-SELECTION.
WRITE: / 'PARAMETER:', PS_PARM.

search help:

create a search help thru se11 >search help> 'ABC'...

parameter: pa_sh for table-field matchcode object 'ABC'.

..............

award points if helpful

Hi,

c the code....

declaring the dates.....

data: textbox1 type dats,

textbox2 type dats.

if for this u want to put a search help follow the procedure below...

If the data eleement corresponding to the fields does't have an associated search help, then do the following:

1. create a view on the table with the required fields.

2. create a search help and assign the 'selection method' with the view name.

inside the search help you supress the unwanted fields by not giving the LPos

SPos, select the dialog type as 'display with restriction' and tick 'SDis'.

3. Now in the selection screen after the data declaration write

matchcode search_help_name

eg.

Parameter p_data type mara-matnr matchcode search_help_name.

Hope this helps.

Regards.

7 REPLIES 7
Read only

former_member156446
Active Contributor
0 Likes
1,000

to get the calender declare the parameters like sy-datum

parameters: pa_begdat type sy-datum.

drop down box:



Check the following code:
TYPE-POOLS: VRM.

DATA: NAME TYPE VRM_ID,
LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST.

PARAMETERS: PS_PARM(10) AS LISTBOX VISIBLE LENGTH 10.

AT SELECTION-SCREEN OUTPUT.

NAME = 'PS_PARM'.
VALUE-KEY = '1'.

VALUE-TEXT = 'LINE 1'.
APPEND VALUE TO LIST. VALUE-KEY = '2'.

VALUE-TEXT = 'LINE 2'.
APPEND VALUE TO LIST.

CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.

START-OF-SELECTION.
WRITE: / 'PARAMETER:', PS_PARM.

search help:

create a search help thru se11 >search help> 'ABC'...

parameter: pa_sh for table-field matchcode object 'ABC'.

..............

award points if helpful

Read only

0 Likes
999

Hi,

The code which u have posted will work for table control. But since am using ALV grids this code will not work.

Please provide a different solution

Read only

Former Member
0 Likes
999

Hi,

For Calender define the selection screen type begda or endda ... you will get F4 help on the selection screen.

To set values in drop box in selection screen use FM 'VRM_SET_VALUES'.

To maintain values in HRP1001 use FM 'HR_MAINTAIN_MASTERDATA'.

Jayant Sahu.

Read only

Former Member
0 Likes
999

If you are taking about F4 Help in ALV for the field then you can try this...

when you create the fieldcatalog you have to set equal 'X' the field ls_fcat-F4AVAILABL after that you can set handler and register event.

Usually the fieldcatlog set F4AVAILABL = 'X' only if the referred structure have linked (directly or not) a Search Help.

For Example

ls_field-f4availabl = 'X'.

ls_field-checktable = 'T702G'.

ls_field-ref_table = 'PTRV_HEAD'.

ls_field-ref_field = 'KZREA'.

Hope that is usefull.

It is not clear in the question what you wanted to ask

Jayant Sahu.

Read only

Former Member
0 Likes
999

Hi,

If you are looking for a F4 Help then this will surely help you kindly check it out in SE38.

F4 help – using internal table example:

DATA: BEGIN OF LI_FABGRP OCCURS 0,

FABGRP LIKE ZAPO_FABGRP-FABGRP,

BEGDA LIKE ZAPO_FABGRP-BEGDA,

END OF LI_FABGRP.

DATA : T_RETURN TYPE STANDARD TABLE OF DDSHRETVAL WITH HEADER LINE,

L_RETFIELD TYPE DFIES-FIELDNAME.

parameters : S_FABGR like ZAPO_FABGRP-FABGRP.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_FABGR.

SELECT FABGRP BEGDA FROM ZAPO_FABGRP INTO table LI_FABGRP.

SORT LI_FABGRP BY FABGRP ASCENDING BEGDA DESCENDING.

Henter de mulige fabriksgrupper med nyeste BEGDA *indenfor hver

DELETE ADJACENT DUPLICATES FROM LI_FABGRP COMPARING FABGRP.

L_RETFIELD = 'FABGRP'.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = L_RETFIELD

DYNPPROG = SY-REPID

DYNPNR = '1000'

DYNPROFIELD = 'S_FABGR'

VALUE_ORG = 'S'

MULTIPLE_CHOICE = ' '

TABLES

VALUE_TAB = LI_FABGRP

RETURN_TAB = T_RETURN

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

F4 help – using field example:

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_FABGR.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

EXPORTING

tabname = mara

fieldname = matnr

SEARCHHELP = ' '

SHLPPARAM = ' '

DYNPPROG = ' '

DYNPNR = ' '

DYNPROFIELD = ' '

STEPL = 0

VALUE = ' '

MULTIPLE_CHOICE = ' '

DISPLAY = ' '

SUPPRESS_RECORDLIST = ' '

CALLBACK_PROGRAM = ' '

CALLBACK_FORM = ' '

SELECTION_SCREEN = ' '

IMPORTING

USER_RESET =

TABLES

RETURN_TAB =

EXCEPTIONS

FIELD_NOT_FOUND = 1

NO_HELP_FOR_FIELD = 2

INCONSISTENT_HELP = 3

NO_VALUES_FOUND = 4

OTHERS = 5

.

KINDLY REWARD IF USEFUL.

Chaitanya.

Read only

Former Member
0 Likes
999

Hi,

c the code....

declaring the dates.....

data: textbox1 type dats,

textbox2 type dats.

if for this u want to put a search help follow the procedure below...

If the data eleement corresponding to the fields does't have an associated search help, then do the following:

1. create a view on the table with the required fields.

2. create a search help and assign the 'selection method' with the view name.

inside the search help you supress the unwanted fields by not giving the LPos

SPos, select the dialog type as 'display with restriction' and tick 'SDis'.

3. Now in the selection screen after the data declaration write

matchcode search_help_name

eg.

Parameter p_data type mara-matnr matchcode search_help_name.

Hope this helps.

Regards.

Read only

Former Member
0 Likes
999

please refer to std. prog.

BCALV_EDIT_06

BCALV_EDIT_07

for dropdown in alv.