Related of this document
F -calla routine
You can callinternal routines(agreed in the modulpool) and external.
In the case ofan external routine,the program nameisshown inbrackets behindthe routine.It is notpossible to specifyparameterswhileusing.When callingan external routine, all data should be agreedona common part. To return the valuesof the routine,are availableRP50Dstructure fieldsthat are not usedin the standard systemand mayenter data intothese fields usingroutine andthencan be used topresetdata(commandsW).
Thus,routinescanbe madebycustomerownallthe above actions.
Example 1:
InfotypeField.....PartInd.Variablefunction
0016 PRBZT F PROBATION
0016 PRBZT I INS,19,01
0016 PRBZT W P0019-VTRMN=PRBEND
InMP001600modulpooltherea routinethat determinesPROBATION, fromentriesfieldsandP0016-P0016-PRBBEH PRBZT, the end of the trial periodandactivein the fieldPRBEND. It then createsa new recordoftermdeadlinePRBENDequal.
Example 2:
InfotypeField.....PartInd.Variablefunction
0001 F GET_DATE(ZPUDYN01)
0001 I INS,19,01
0001 W P0019-VTRMN=RP50D-DATE1
The routineZPUDYN01GET_DATEin the programcalculates adate andincludesfield-DATE1 RP50DAcoradoby"RP50DTABLES" inZPUDYN01. This datecan be calculatedwithout anyGET_DATEproblem, ifnecessary,can be readinfotypesetc..
M-Sending amail
Here you must specifythe name ofa feature thatdeterminesthe properties of amail.
Example:
InfotypeField.....PartInd.Variablefunction
0001 SACHP M M0001
Thus,by modifyingthe fieldSACHPmailis sent. M0001Indeterminingthe characteristicpropertiesmail. The standardcharacteristicis suppliedexemplaryM0001. Documentation forthis featuredescribes howyou can definethe properties of themail.
Dynamic measurementsinBatch Input:
Alimitationis thatproactive measuresare not executedviabatch input, this is whatthestandardsays:
"Notesfor creatingbatch inputdata sets: Proactive measuresare not processedinbatch inputdata sets. In thebatch inputshould indicate theexact sequence ofdynpros. To ensure this,andshould be scheduledchecksproactive measurestocreate thebatch inputdata set. To avoid errorsin schedulingand processingof the data setin thebatch inputprocessingonlystatistical measures. Infotypecallsentering thesystem throughproactive measuresshould be madeby callingtransactionown. This preventsuseful(in principle)tomassmodificationprocessesgivesmasterdata, as may be thecase of adata migration.Toskipthis restrictionwould have tomodify thestandardprogram codeMPPERS00
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.
CreatingDynamicActions in runtime:
With the help oftablesanddynmeasinitial_values, and declaringthemppdat00include:
>>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