Skip to Content
author's profile photo Former Member
Former Member

Help on F4 Help

Hi,

I have a problem coding help on a selection screen. The scenario is like this.

I have to fields on a selection screen :

PARAMETERS : VBELN TYPE VBAK-VBELN,

ERDAT TYPE VBAK-ERDAT AS LISTBOX VISIBLE LENGTH 10.

Now I want to have help coded in such a way that when the user fills in some value in VBELN (say 4969) and moves to

ERDAT I want the only the dates related to '4696' listed in the listbox.

I have already tried the AT SELECTION SCREEN ON ERDAT event. I dont receive the value of field VBELN here as the PAI event is not yet triggered and the values have not yet been transported to the ABAP Program. There is no point in trying any FM coz as stated above I dont receive the VBELN value entered by the user.

I have implemented this using a structure with fields VBAK-VBELN and VBAK-ERDAT. Created a search help and attached the search help to the fields of the structure. Used this structure to get display a list of related dates. But the requirement is not displaying related dates it is displaying related dates in a listbox. Any help would be highly appriciated.

Thanx in advance for any comments as to if this is possible or not and if it is possible a hint in the right direction for this problem.

Best regards,

Kazmi.

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Aug 05, 2004 at 05:03 PM

    Have you tried with FM <b>DYNP_VALUES_READ</b>? This FM updates all fields from a given Dynpro and program.

    From the standard documentation.

    <i>Read field contents on screen and transport field to help processor</i>

    I hope this helps you

    Add comment
    10|10000 characters needed characters exceeded

    • Implement the following code. This should give you some hints. FYI, in this sample, you will only ever get one value in the dropdown box. You can only have one creation date for a sales document header. I was assuming that you were using as example.

      Regards,

      Rich Heilman

      REPORT ZRICH_0009 .

      TYPE-POOLS: VRM.

      PARAMETERS : VBELN TYPE VBAK-VBELN,

      ERDAT TYPE VBAK-ERDAT AS LISTBOX VISIBLE LENGTH 10.

      AT SELECTION-SCREEN OUTPUT.

      PERFORM PREPARE_LISTBOX USING VBELN.

      START-OF-SELECTION.

      WRITE:/ SY-SUBRC .

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

      • Form PREPARE_LISTBOX

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

      FORM PREPARE_LISTBOX USING VBELN.

      DATA: NAME TYPE VRM_ID,

      LIST TYPE VRM_VALUES,

      VALUE LIKE LINE OF LIST.

      DATA: IVBAK LIKE VBAK OCCURS 0 WITH HEADER LINE.

      CLEAR LIST. REFRESH LIST.

      CLEAR IVBAK. REFRESH IVBAK.

      SELECT VBELN ERDAT INTO CORRESPONDING FIELDS OF TABLE IVBAK

      FROM VBAK

      WHERE VBELN = VBELN.

      LOOP AT IVBAK.

      VALUE-KEY = IVBAK-ERDAT.

      CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'

      EXPORTING

      DATE_INTERNAL = IVBAK-ERDAT

      IMPORTING

      DATE_EXTERNAL = VALUE-TEXT.

      APPEND VALUE TO LIST.

      ENDLOOP.

      NAME = 'ERDAT'.

      CALL FUNCTION 'VRM_SET_VALUES'

      EXPORTING

      ID = NAME

      VALUES = LIST.

      ENDFORM.