Skip to Content

Related of this document

Dinamic Actions II

F – call a routine
You can call internal routines (agreed in the modulpool) and external.


In the case of an external routine, the program name is shown in brackets behind the routine. It is not possible to specify parameters while using. When calling an external routine, all data should be agreed on a common part. To return the values โ€‹โ€‹of the routine, are available RP50D structure fields that are not used in the standard system and may enter data into these fields using routine and then can be used to preset data (commands W ).
Thus, routines can be made by customer own all the above actions.

Example 1:
Infotype Field ….. Part Ind. Variable function

0016 PRBZT F PROBATION

0016 PRBZT I INS,19,01

0016 PRBZT W P0019-VTRMN=PRBEND

In MP001600 modulpool there a routine that determines PROBATION, from entries fields and P0016P0016PRBBEH PRBZT, the end of the trial period and active in the field PRBEND. It then creates a new record of term deadline PRBEND equal.

Example 2:

Infotype Field ….. Part Ind. Variable function

0001 F GET_DATE(ZPUDYN01)

0001 I INS,19,01

0001 W P0019-VTRMN=RP50D-DATE1

The routine ZPUDYN01 GET_DATE in the program calculates a date and includes fieldDATE1 RP50D Acorado by RP50D TABLESin ZPUDYN01. This date can be calculated without any GET_DATE problem, if necessary, can be read infotypes etc..

MSending a mail
Here you must specify the name of a feature that determines the properties of a mail.

Example:

Infotype Field ….. Part Ind. Variable function

0001 SACHP M M0001

Thus, by modifying the field SACHP mail is sent. M0001 In determining the characteristic properties mail. The standard characteristic is supplied exemplary M0001. Documentation for this feature describes how you can define the properties of the mail.

Dynamic measurements in Batch Input:
A limitation is that proactive measures are not executed via batch input, this is what the standard says:


“Notes for creating batch input data sets: Proactive measures are not processed in batch input data sets. In the batch input should indicate the exact sequence of dynpros. To ensure this, and should be scheduled checks proactive measures to create the batch input data set. To avoid errors in scheduling and processing of the data set in the batch input processing only statistical measures. Infotype calls entering the system through proactive measures should be made by calling transaction own. This prevents useful (in principle) to mass modification processes gives master data, as may be the case of a data migration. To skip this restriction would have to modify the standard program code MPPERS00

IF SY-BINPT EQ SPACE.

<<——— AQUI LO CONTROLA

* befinden wir uns im ALE-Eingang ?

CLEAR: ALE_FLAG. “XFYAHRK063273

CALL FUNCTION ‘RHAP_ALE_FLG_GET’ “XFYAHRK063273

IMPORTING “XFYAHRK063273 ALE_FLG = ALE_FLAG. “XFYAHRK063273

IF ALE_FLAG IS INITIAL. “XFYAHRK063273

     IF PSPAR-VINFT NE SPACE. “infotype view “XYLPH9K007065

           PERFORM DYN_MEASURE IN PROGRAM (VIEW_REPID). “XYLPH9K007065

      ELSE. “XYLPH9K007065

           PERFORM DYN_MEASURE.

      ENDIF. “XYLPH9K007065

      PERFORM PROCESS_MEASURE(SAPFP50M).

      IF PSPAR-MASSN EQ SPACE. “XYLN160088_2

* depth in rp_infotyp(sapfp50g) computed “XYLN160088_3

* begin correction XYLN208111

* IMPORT depth FROM MEMORY ID ‘DYNMEAS_DEPTH’.”XYLN160088_2

          CALL FUNCTION ‘HRPAD00_GET_DYNMEAS_DEPTH’

               IMPORTING

                    DEPTH = DEPTH.

* end correction XYLN208111

          IF DEPTH = 1. “XYLN160088_3

* if depth = 0. “XYLN160088_2 ”

* Dyn. Massn. beendet, Zaehler initalisieren XYLN160088_2

          CLEAR: PSPAR-DMSNR, LAST_DMSNR. “XYLN160088_2

* begin correction XYLN208111

* free memory id ‘LAST_DMSNR’. “XYLN160088_2

          CALL FUNCTION ‘HRPAD00_FREE_LAST_DMSNR’.

* end correction XYLN208111

          CLEAR INITIAL_VALUES. “XYLN160088_2

          REFRESH INITIAL_VALUES. “XYLN160088_2

     ENDIF. “XYLN160088_2

ENDIF. “XYLN160088_2

ENDIF. “XFYAHRK063273

ENDIF.

Creating Dynamic Actions in runtime:


With the help of tables and dynmeas initial_valuesโ€‹โ€‹, and declaring the mppdat00 include:

>>BEGIN CODE

PROGRAM Z_MEDIDA.

INCLUDE MPPDAT00.

*/ Generación de Infotipo 0041 dinámicamente

FORM GENERATE_0041.

     DATA: X0016 LIKE P0016 OCCURS 0 WITH HEADER LINE.

     DATA: AUX_FECHA TYPE D.

*/ Aux_Fecha nos da la fecha para buscar el IT0016

CLEAR AUX_FECHA.

AUX_FECHA = PSPAR-BEGDA – 1.

IF PSPAR-MASSN = ‘E2’ OR PSPAR-MASSN = ‘E7’.

CALL FUNCTION ‘HR_READ_INFOTYPE’

     EXPORTING

           PERNR = PSPAR-PERNR

           INFTY = ‘0016’

           BEGDA = AUX_FECHA

          ENDDA = AUX_FECHA

TABLES

           INFTY_TAB = X0016

EXCEPTIONS

           INFTY_NOT_FOUND = 1

           OTHERS = 2.

READ TABLE X0016 INDEX 1.

*/ Tabla initial_values

CLEAR INITIAL_VALUES. REFRESH INITIAL_VALUES.

INITIAL_VALUES-FIELD_NAME = ‘P0041-DAR01’.

INITIAL_VALUES-FIELD_VALUE = ‘Z1’.

ADD 1 TO INITIAL_VALUES-SEQNR. APPEND INITIAL_VALUES. CLEAR INITIAL_VALUES.

INITIAL_VALUES-FIELD_NAME = ‘P0041-DAT01’.

INITIAL_VALUES-FIELD_VALUE = X0016-EINDT.

ADD 1 TO INITIAL_VALUES-SEQNR.

APPEND INITIAL_VALUES. CLEAR INITIAL_VALUES.

*/ Tabla Dynmeas

DYNMEAS-ACTIO = ‘INS’.

DYNMEAS-INFTY = ‘0041’.

DYNMEAS-BEGDA = AUX_FECHA.

DYNMEAS-ENDDA = AUX_FECHA.

* dynmeas-supdg = ‘X’. “Poner ‘D’ si queremos suprimir diálogo

ADD 1 TO DYNMEAS-SEQNR.

APPEND DYNMEAS. CLEAR DYNMEAS.

ENDIF.

ENDFORM. “generate_0041

<<END CODE


To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply