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

FunCode in List box throws error.

Former Member
0 Likes
860

Hi All,

I got the fixed values of a Domain into a list box in a screen.

Now Based on the selection in the List box I need some other screen number say 902 values to be changed say disabling a radio button.

I declared the FunCode and wrote some piece to chek if it triggers in the PAI of the screen 902.

When I on the debugging and see the FuncCode it only says me Enter the Valid value.

But I am seeing only the correct values everytime ...

Any inputs would be appreciated.

Thanks in advance.

regards,

Krishna.

Guys ......Can someone try this for me and tell a solution ??

hope all understood the problem

Edited by: Krishna on Jan 20, 2009 5:53 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
795

Show us code.

6 REPLIES 6
Read only

Former Member
0 Likes
796

Show us code.

Read only

0 Likes
795

Hi ,

The code i as below.

ZSELCONSUL is the domain and it has some 10 fixed values declared.

I can see all the values in the drop down but the issue is when I try to select anyone , then it says "Enter a valid value ".Strangely this happens only if I put the Function Code value in the attributes of the Field. If I remove the FunCode it just works fine.

But based on the value selected I need to modify screen values.Like want to deactivate some radio buttons.

*GET THE DOMAIN VALUES FOR THE PROC METHOD CONSULTANTS

DATA : LIST4 type VRM_VALUES OCCURS 0,

VALUE4 LIKE LINE OF LIST3,

L4_DD07 TYPE DD07V OCCURS 0,

ZSELCONSUL TYPE DDOBJNAME.

CALL FUNCTION 'DDIF_DOMA_GET'

EXPORTING

NAME = 'ZSELCONSUL'

STATE = 'A'

LANGU = SY-LANGU

  • IMPORTING

  • GOTSTATE =

  • DD01V_WA =

TABLES

DD07V_TAB = L4_DD07

EXCEPTIONS

ILLEGAL_INPUT = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

VALUE4[] = l4_dd07[].

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = 'Z712-SELMETHOD'

VALUES = value4[]

EXCEPTIONS

ID_ILLEGAL_NAME = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

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

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

ENDIF.

ENDMODULE. " FILL OUTPUT

Thanks for your interest.

Regards,

Krishna.

Read only

0 Likes
795

What I don't see in your code is where you would move from the DD07_TAB to your VRM_RESULTs tab.

May I suggest you build the listbox data like this.


" In your TOP Include
TYPE-POOLS             vrm.


DATA: applvl_field       TYPE vrm_id,
      applvl_result      TYPE STANDARD TABLE OF vrm_value,
      applvl_val         LIKE LINE OF applvl_result,
      applvl_rec         TYPE vrm_value.


" In your Screen PBO
PROCESS BEFORE OUTPUT.
  MODULE status_0100.

  MODULE init_0100.

" In your Screen OUT Include
MODULE init_0100 OUTPUT.

  PERFORM build_drop_down_tables.

  applvl_field = 'MT_APPROVERS_REC-APPR_LEVEL'.
  CALL FUNCTION 'VRM_SET_VALUES'
       EXPORTING
            id              = applvl_field
            values          = applvl_result
       EXCEPTIONS
            id_illegal_name = 1
            OTHERS          = 2.

ENDMODULE.                 " init_0100  OUTPUT

" In your Screen Function Include

*&---------------------------------------------------------------------*
*&      Form  build_drop_down_tables
*&---------------------------------------------------------------------*
FORM build_drop_down_tables.

  PERFORM build_appr_lvl_values.

ENDFORM.                    " build_drop_down_tables


FORM build_appr_lvl_values.
  CHECK applvl_result IS INITIAL.

  REFRESH: applvl_result.

  SELECT domvalue_l ddtext
    INTO TABLE applvl_result
    FROM dd07t
    WHERE domname = 'Z_APPR_REQ2'
      AND ddlanguage = sy-langu
      AND domvalue_l NE c_field_rep.

ENDFORM.                    " build_appr_lvl_values

As the other poster mentioned you should have your Function Code on the field itself.

Why you would need a Function Code.. unless your changes area on the same screen, I have no idea.

Way I would handle it is that every time you process through your PBO of the 902 screen, you make

determinations there as to how to change SCREEN attributes. Switches and such are a request for

unneeded trouble.

Edited by: Paul Chapman on Jan 20, 2009 2:51 PM

Read only

0 Likes
795

Hi Paul Thanks again for showing the interest .

Using this statement I am passign the values. VALUE4[] = l4_dd07[].

The reason why I am passing the function code value in the field attributes is ,once the user selects any one value from the dropdown ,based on that field value , I should de avtivate some of the other fields in the same screen.

Sure I would try your way , I would try to handle the screen modifications in the PBO of 902 screen.

Pls also confirm if placing a FuncCode does work or its not the to be handled at all.

Sorry for poking into this FuncCode thing.

Regards,

Krishna.

Edited by: Krishna on Jan 20, 2009 9:08 PM

Read only

0 Likes
795

Hi Paul,

Thanks , that worked .

May be i doubt I am passing some wrong parameter value to the FM below.

  • CALL FUNCTION 'DDIF_DOMA_GET'

  • EXPORTING

  • NAME = 'ZCONTRACTTYP'

  • STATE = 'A ' -------------------------> I doubt this.

  • LANGU = SY-LANGU

    • IMPORTING

    • GOTSTATE =

    • DD01V_WA =

  • TABLES

  • DD07V_TAB = L_DD07

    • EXCEPTIONS

    • ILLEGAL_INPUT = 1

    • OTHERS = 2

Now the Functin code also works fine.I made you a bit richer.

Regards,

Krishna.

Read only

Former Member
0 Likes
795

I hope you've assigned the function code to the list box.

regards,

Advait