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

Search help -error

Former Member
0 Likes
596

Hi experts,

This is my coding part.

My requirement is to set the search help to the input field ZRNO (Parameter).

I have done coding part for this, but when i put F4, values are populated but when i select a particular value and press enter, goes to dump saying the errro,

System trying to send the Message ' ' .

this field in the table ZRECPT.

Pls, suggest me on the same, and tell me the solution.

Regards

Rajaram

&----


*& Report ZSAB_RECEIPT

*&

&----


*&

*&

&----


REPORT ZSAB_RECEIPT.

tables : zrecpt.

DATA : BEGIN OF itab OCCURS 0.

INCLUDE STRUCTURE ZRECP.

DATA : END OF itab.

DATA : fm_name TYPE rs38l_fnam.

*DATA : wa_ctl type zsctl.

DATA : w_formname TYPE tdsfname. "form name

DATA : w_total type zrecpt-zamt,

w_words TYPE string, "amount in words

w_wort(200).

                      • sEARCH hELP

DATA:dynfields TYPE TABLE OF dynpread WITH HEADER LINE.

DATA:return LIKE ddshretval OCCURS 0 WITH HEADER LINE.

DATA:dynmap TYPE TABLE OF dselc WITH HEADER LINE.

DATA fieldtab LIKE dfies OCCURS 0 WITH HEADER LINE.

DATA:BEGIN OF tab OCCURS 0,

ZRNO LIKE ZRECPT-ZRNO,

VBELN LIKE ZRECPT-VBELN,

WERKS LIKE ZRECPT-WERKS,

ZOFFICE LIKE ZRECPT-ZOFFICE,

END OF tab.

w_formname = 'ZSAB_RECEIPT'.

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

PARAMETERS RNO TYPE ZRECPT-ZRNO.

SELECTION-SCREEN END OF BLOCK bk1.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR RNO.

PERFORM search_help_fieldname .

SELECT ZRNO

WERKS

APRDAT

VBELN

ZAMT

ZRBY

ZOFFICE

ZCASH

ZCHQ

ZDD

ZNUMB1

ZBANK

ZBPLACE

from ZRECPT

into corresponding fields of table itab

where zrno = rno.

loop at itab.

w_total = itab-zamt.

endloop.

CALL FUNCTION 'ZSPELL_AMOUNT'

EXPORTING

amount = w_total

IMPORTING

words = w_words

wort = w_wort

EXCEPTIONS

exceed = 1

OTHERS = 2.

CONDENSE : w_words,

w_wort.

sort itab by zrno.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = w_formname

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = fm_name

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 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.

CALL FUNCTION fm_name

  • EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

TABLES

itab = itab

EXCEPTIONS

FORMATTING_ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3

USER_CANCELED = 4

OTHERS = 5

.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

&----


*& Form search_help_fieldname

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM search_help_fieldname .

SELECT ZRNO WERKS VBELN ZOFFICE FROM ZRECPT

INTO CORRESPONDING FIELDS OF TABLE tab

WHERE WERKS = '1180'.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'ZRNO'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'ZRECPT-ZRNO'

value_org = 'S'

display = 'F'

TABLES

value_tab = tab

return_tab = return

dynpfld_mapping = dynmap

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.

READ TABLE return WITH KEY fieldname = 'ZRECPT-ZRNO'.

REFRESH : dynfields.

dynfields-fieldname = return-retfield.

dynfields-fieldvalue = return-fieldval.

APPEND dynfields.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = sy-cprog

dynumb = sy-dynnr

TABLES

dynpfields = dynfields

EXCEPTIONS

OTHERS = 8.

Endif.

ENDFORM. " search_help_fieldname

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
566

hi,

Why dont u make search help through SE11.

Give werks = '1180' in default value.

and instaed of

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

PARAMETERS RNO TYPE ZRECPT-ZRNO.

SELECTION-SCREEN END OF BLOCK bk1.

write,

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

PARAMETERS RNO TYPE ZRECPT-ZRNO MATCHCODE OBJECT zrno_help.

SELECTION-SCREEN END OF BLOCK bk1.

<b>zrno_help</b> is search help name.

Hope it will b helpful.

4 REPLIES 4
Read only

Former Member
0 Likes
566

Hi just go through the dumb analysis report.

And find out in which line u got dumb error.

Also the dumb report contains the reason for the dumb error.

Then u itself rectify the error.

Then let meknow it.

I will try to bring the solution.

May be u have to vary the screen fields length for which u r trying to populate the records using search help. Check it out.

Please reward points if helpful.

Read only

Former Member
0 Likes
567

hi,

Why dont u make search help through SE11.

Give werks = '1180' in default value.

and instaed of

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

PARAMETERS RNO TYPE ZRECPT-ZRNO.

SELECTION-SCREEN END OF BLOCK bk1.

write,

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

PARAMETERS RNO TYPE ZRECPT-ZRNO MATCHCODE OBJECT zrno_help.

SELECTION-SCREEN END OF BLOCK bk1.

<b>zrno_help</b> is search help name.

Hope it will b helpful.

Read only

Former Member
0 Likes
566

Hi,

Refer to my code as follows:

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_WERK-LOW.

REFRESH ITEMP.

CLEAR ITEMP.

SELECT WERKS

NAME1

FROM T001W

INTO TABLE ITEMP

WHERE IWERK = 'M011'.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'WERKS'

  • PVALKEY = ' '

  • DYNPPROG = ' '

  • DYNPNR = ' '

  • DYNPROFIELD = ' '

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

TABLES

VALUE_TAB = ITEMP

  • FIELD_TAB =

RETURN_TAB = T_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.

S_WERK-LOW = T_RETURN-FIELDVAL

Hope this helps.

Reward if helpful.

Regards,

Sipra

Read only

varma_narayana
Active Contributor
0 Likes
566

Hi rajaram..

This the Problem with the dynprofield parameter: check the correction below.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'ZRNO'

dynpprog = sy-repid

dynpnr = sy-dynnr

<b>dynprofield = 'ZRNO' "Screen field / Parameter Name</b>

value_org = 'S'

display = 'F'

TABLES

value_tab = tab

return_tab = return

dynpfld_mapping = dynmap

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

reward if Helpful.