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

F4 search help

Former Member
0 Likes
2,723

HI...

I have to select VBELN (sales documents number ) for VBTYP 'G' (contract no) using f4 search help.

for this I am using CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

but it is selecting all VBELN.

for this select query is not working....

is there any method for this type of search help...

pls help..

Regards

Lokesh

Moderator message: please choose more descriptive subject lines for your posts.

Edited by: Thomas Zloch on May 20, 2011 9:41 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,406

hi,

write this code in your flowlogic after PAI

PROCESS ON VALUE-REQUEST.

FIELD WA1-ZUSERTYPE MODULE create_dropdown_box. "field on which you want dropdown

define this module

MODULE create_dropdown_box INPUT.

TYPES :BEGIN OF itab,

zusertype TYPE zemplogin_rms-zusertype,

END OF itab.

DATA :itab1 TYPE STANDARD TABLE OF itab.

SELECT DISTINCT zusertype

FROM zemplogin_rms

INTO TABLE itab1 .

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'ZUSERTYPE'

value_org = 'S'

TABLES

value_tab = itab1

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc <> 0.

...

ENDIF.

ENDMODULE. " CREATE_DROPDOWN_BOX INPUT

hi,

write this code in your flowlogic after PAI

PROCESS ON VALUE-REQUEST.

FIELD WA1-ZUSERTYPE MODULE create_dropdown_box. "field on which you want dropdown

define this module

MODULE create_dropdown_box INPUT.

TYPES :BEGIN OF itab,

zusertype TYPE zemplogin_rms-zusertype,

END OF itab.

DATA :itab1 TYPE STANDARD TABLE OF itab.

SELECT DISTINCT zusertype

FROM zemplogin_rms

INTO TABLE itab1 .

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'ZUSERTYPE'

value_org = 'S'

TABLES

value_tab = itab1

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc <> 0.

...

ENDIF.

ENDMODULE. " CREATE_DROPDOWN_BOX INPUT

17 REPLIES 17
Read only

Former Member
0 Likes
2,406

you need to pass values to internal table filtering values as per requirment.Teh function module would jsut display teh values you pass to it.So in teh select statmenet specify it in teh where clause.

Read only

0 Likes
2,406

I am using same but it is displaying all list...

Read only

0 Likes
2,406

at selection-screen on value-request for p_vbeln.

*select * from vbak*
           *into table it_vbeln*
           *where  VBTYP 'G'* 

***Here in where condition you have to spciecify the condition
***Based on condition you ill get the coresponding output

  if sy-subrc eq 0.
        call function 'F4IF_INT_TABLE_VALUE_REQUEST'
          exporting
            window_title           = 'SO LIst'

            value_org              = 'S'

          tables
            value_tab              = it_vbeln

            return_tab             = it_return

         exceptions
           parameter_error        = 1
           no_values_found        = 2
           others                 = 3.

Read only

0 Likes
2,406

Please paste your code.

Read only

0 Likes
2,406

TABLES : VBAK,

CSKS.

...........structure.........................

TYPES:BEGIN OF STAB_VBAK,

VBELN TYPE VBAK-VBELN,

VBTYP TYPE VBAK-VBTYP,

END OF STAB_vbak.

DATA: ITAB_VBAK type TABLE OF STAB_VBAK ,

WA_VBAK type STAB_VBAK.

DATA: IT_RETURN LIKE STANDARD TABLE OF DDSHRETVAL,

wa_return like line of IT_RETURN.

select vbeln vbtyp

from vbak

into itab_VBAK

where vbtyp eq 'G'.

if sy-subrc eq 0.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'CONTRACTNUMBER'

  • PVALKEY = ' '

DYNPPROG = sy-repid

DYNPNR = sy-dynnr

  • DYNPROFIELD = ' '

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = ITAB_vbak

  • FIELD_TAB =

RETURN_TAB = IT_RETURN

  • 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.

write IT_RETURN-FIELDVAL to CONTRACTNUMBER.

ENDIF.

Read only

0 Likes
2,406

Hi , you need to write this code at At selection screen event.

Put a breakpoint after the select statement and see, what velues are you getting.

Before and after you click on F4.

Read only

0 Likes
2,406

Hi,

Modify your code int his format.



AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_name.  "In the place of p_name give your field name.    Ex : "CONTRACTNUMBER"
   
select vbeln vbtyp
from vbak
into table itab_VBAK
where vbtyp eq 'G'.

if sy-subrc eq 0.


CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
RETFIELD = 'CONTRACTNUMBER'
* PVALKEY = ' '
DYNPPROG = sy-repid
DYNPNR = sy-dynnr
* DYNPROFIELD = ' '
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
VALUE_ORG = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
VALUE_TAB = ITAB_vbak
* FIELD_TAB =
RETURN_TAB = IT_RETURN
* 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.
write IT_RETURN-FIELDVAL to CONTRACTNUMBER.
ENDIF.

Regards,

Harish

Read only

0 Likes
2,406

Hi,

You dont write the code in PAI and PBO event. If you want the F4 help you should write the code in POV event.

Please write the below code.

PROCESS ON VALUE-REQUEST.

FIELD vbeln MODULE vbeln_f4.

and one thing change your select query like this

select vbeln vbtyp

from vbak

into table itab_VBAK "mention into table then only you get the all records

where vbtyp eq 'G'.

Regards,

Dhina..

Read only

Former Member
0 Likes
2,406

Hi Thuwal,

Can you please paste your code ?

Read only

Former Member
0 Likes
2,407

hi,

write this code in your flowlogic after PAI

PROCESS ON VALUE-REQUEST.

FIELD WA1-ZUSERTYPE MODULE create_dropdown_box. "field on which you want dropdown

define this module

MODULE create_dropdown_box INPUT.

TYPES :BEGIN OF itab,

zusertype TYPE zemplogin_rms-zusertype,

END OF itab.

DATA :itab1 TYPE STANDARD TABLE OF itab.

SELECT DISTINCT zusertype

FROM zemplogin_rms

INTO TABLE itab1 .

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'ZUSERTYPE'

value_org = 'S'

TABLES

value_tab = itab1

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc <> 0.

...

ENDIF.

ENDMODULE. " CREATE_DROPDOWN_BOX INPUT

Read only

pawan_rai
Participant
0 Likes
2,406

hi,

In your code Before call function give At Selection screen on value request for ( parameter your passing in selection screen)

Regards,

Pawan

Read only

Former Member
0 Likes
2,406

At Selection screen will not work because it is an include program.

and it is a part of functional exit of an enhancement object.

so i have to write code in PAI and PBI.

Read only

0 Likes
2,406

No, you have to code your FIELD MODULE in the flow logic POV [PROCESS ON VALUE-REQUEST|http://help.sap.com/abapdocu_70/en/DYNPPROCESS.htm#&ABAP_ALTERNATIVE_4@4@] part of the code, else standard F4 will be used, and the whole table will be displayed.

PROCESS ON VALUE-REQUEST.
  FIELD vbeln MODULE vbeln_f4.

Regards,

Raymond

Read only

Former Member
0 Likes
2,406

Hi,

Try with below code...

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.

Ram.

Read only

former_member300258
Participant
0 Likes
2,406

try this one...

select-options: s_vbeln for vbak-vbeln.

AT SELECTION-SCREEN on value-request for s_vbeln-low.

perform get_vbeln using 'S_VBELN'.

AT SELECTION-SCREEN on value-request for s_vbeln-high.

perform get_vbeln using 'S_VBELN'.

.

.

.

.

.

.

FORM get_vbeln using fieldname.

data: begin of it_vbak,

vbeln type vbak-vbeln,

vbtyp type vbak-vbtyp,

end of it_vbak.

select vbeln vbtyp into table it_vbak FROM VBAK

WHERE vbtyp = 'G'.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'VBTYP'

  • PVALKEY = ' '

DYNPPROG = 'SY-CPROG'

DYNPNR = SY-DYNNR

DYNPROFIELD = 'S_VBTYP'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

CALLBACK_PROGRAM = 'SY-CPROG'

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

tables

value_tab = it_vbak

  • 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.

ENDFORM.

Edited by: Kalidass Etienne.S on May 20, 2011 3:37 PM

Read only

Former Member
0 Likes
2,406

Hi Thuwal,

Try with Below Code.

***********************************************************************

  • SELECTION-SCREEN

***********************************************************************

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: p_vbeln TYPE VBAK-vbeln.

SELECTION-SCREEN END OF BLOCK b1.

  • At selection-screen.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vbeln.

PERFORM Document_no.

FORM document_no .

DATA: it_return LIKE ddshretval OCCURS 0 WITH HEADER LINE.

DATA: it_dynpfld_mapping LIKE dselc OCCURS 0 WITH HEADER LINE.

DATA:BEGIN OF it_tab OCCURS 0,

vbeln LIKE vbak-vbeln,

END OF it_tab.

SELECT vbeln FROM Table INTO TABLE Internal it_tab

WHERE VBTYP EQ 'G'.

DELETE ADJACENT DUPLICATES FROM it_tab Comparing vbeln.

SORT it_tab.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'P_VBELN'

dynpprog = sy-cprog

dynpnr = sy-dynnr

dynprofield = 'P_VBELN'

value_org = 'S'

display = 'F'

TABLES

value_tab = it_tab

return_tab = it_return

dynpfld_mapping = it_dynpfld_mapping.

CLEAR:it_return,it_dynpfld_mapping.

ENDFORM. "

Regards,

Sanjit

Read only

Former Member
0 Likes
2,406

.