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

Problem with selection-screen

Former Member
0 Likes
537

I have a first parameter which is P_PERNR,

IF I enter It and I push enter the others parameters assigned.

I want the others parameters to be avalaible to modify.

If I use AT SELECTION-SCREEN OUTPUT fto assign the fields :

I can modify them but if I push enter they are overwrited by the fields selected with P_PERNR

If I use AT SELECTION-SCREEN ON P_PERNR to assign the fields :

I can modify them but if I change the parameter P_PERNR I doesn't overwrite the others parameters with the new fields selected with P_PERNR.

Could you help me please?

I joined a copy of my code.

Thanks and regards

AT SELECTION-SCREEN ON p_pernr.

IF NOT p_pernr IS INITIAL.

SELECT SINGLE pernr FROM pa0003

INTO pa0003-pernr

WHERE pernr EQ p_pernr.

IF sy-subrc NE 0.

MESSAGE e319(01) WITH text-e01 p_pernr text-e02.

ENDIF.

  • Vérification de l'existence du NT user

CLEAR w_userid.

SELECT usrid UP TO 1 ROWS

FROM pa0105

INTO w_userid

WHERE subty EQ '0003'

AND pernr EQ p_pernr

AND endda GT sy-datum.

ENDSELECT.

IF sy-subrc NE 0.

MESSAGE e319(01) WITH text-e01 p_pernr text-e03.

ENDIF.

  • Vérification de l'existence de l'addresse mail

CLEAR p_mail.

SELECT usrid_long UP TO 1 ROWS

FROM pa0105

INTO p_mail

WHERE subty EQ '0010'

AND pernr EQ p_pernr

AND endda GT sy-datum.

ENDSELECT.

IF sy-subrc NE 0 OR p_mail IS INITIAL.

MESSAGE e319(01) WITH text-e08 text-e09.

ENDIF.

ELSE.

MESSAGE e319(01) WITH text-e04.

ENDIF.

*AT SELECTION-SCREEN OUTPUT.

SELECT nachn vorna UP TO 1 ROWS

FROM pa0002

INTO (p_nachn, p_vorna)

WHERE pernr = p_pernr.

ENDSELECT.

IF sy-subrc NE 0.

CLEAR p_nachn.

CLEAR p_vorna.

ENDIF.

  • SELECT usrid_long UP TO 1 ROWS

  • FROM pa0105

  • INTO p_mail

  • WHERE pernr = p_pernr

  • AND subty = '0010'

  • AND endda GT sy-datum.

  • ENDSELECT.

  • IF sy-subrc NE 0.

  • CLEAR p_mail.

  • ENDIF.

  • Détermination de la start date et de la last date pour l'affectation des roles

  • Ici cette détermination provisoire ne sert qu'à l'affichage.

SELECT begda endda UP TO 1 ROWS

FROM pa0001

INTO (p_begda, p_endda)

WHERE pernr = p_pernr

ORDER BY begda DESCENDING.

ENDSELECT.

  • Si la date de début est dans le passé on fixe la date de début en date du jour

IF p_begda LT sy-datum AND NOT p_begda IS INITIAL.

MOVE sy-datum TO p_begda.

ENDIF.

END-OF-SELECTION.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
493

Hi Bertrand,

YOu have to make use of the function modules:

DYNP_VALUE_UPDATE AND DYNP_VALUES_READ .

regards,

Ravi

4 REPLIES 4
Read only

Former Member
0 Likes
494

Hi Bertrand,

YOu have to make use of the function modules:

DYNP_VALUE_UPDATE AND DYNP_VALUES_READ .

regards,

Ravi

Read only

0 Likes
493

With this following FM call I don't catch the informations.

Do you know why ?

Thanks and regards.

AT SELECTION-SCREEN ON p_pernr.

*AT SELECTION-SCREEN output.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-cprog

dynumb = sy-dynnr

translate_to_upper = ' '

request = ' '

perform_conversion_exits = ' '

perform_input_conversion = ' '

determine_loop_index = ' '

TABLES

dynpfields = wt_dynp

EXCEPTIONS

invalid_abapworkarea = 1

invalid_dynprofield = 2

invalid_dynproname = 3

invalid_dynpronummer = 4

invalid_request = 5

no_fielddescription = 6

invalid_parameter = 7

undefind_error = 8

double_conversion = 9

stepl_not_found = 10

OTHERS = 11.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

Read only

0 Likes
493

YOu need to fill the dynpfields internal table.

the function module i have mentioned are well documented.

YOu can read them for the sameple usage.

Regards,

Ravi

Read only

Former Member
0 Likes
493

HI,

Look at the Fm ..

CALL FUNCTION 'DYNP_VALUES_READ'
       EXPORTING
            DYNAME     = LC_DYNAME
            DYNUMB     = LC_DYNUMB
       TABLES
            dynpfields = ltab_fields
       EXCEPTIONS
            OTHERS     = 01.

To Update the Values on a Screen

CALL FUNCTION 'DYNP_VALUES_UPDATE'
       EXPORTING
            DYNAME     = LC_DYNAME
            DYNUMB     = LC_DYNUMB
       TABLES
            DYNPFIELDS = LTAB_FIELDS
       EXCEPTIONS
            OTHERS     = 8.