Olá,
Verifique o programa uma vez. Aqui você pode carregar os dados de uma planilha do Excel. Você pode fornecer qualquer quantidade de tipos de salários de uma vez.
----
-
TYPE POOLS *
----
TYPE-POOLS: TRUXS.
INCLUDE BDCRECX1.
----
-
INTERNAL TABLES *
----
DATA : BEGIN OF IT_PA0015 OCCURS 0,
PERNR TYPE PA0015-PERNR,
SUBTY TYPE RP50G-SUBTY,
BEGDA TYPE CHAR10,
BETRG TYPE CHAR16,
END OF IT_PA0015.
DATA: IT_RAW TYPE TRUXS_T_TEXT_DATA.
DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
DATA : IT_MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
----
-
SELECTION SCREEN *
----
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETER P_FILE TYPE RLGRAP-FILENAME OBLIGATORIO.
SELECTION-SCREEN END OF BLOCK B1.
----
-
AT SELECTION SCREEN *
----
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
PERFORM HELP_FILE USING P_FILE.
----
-
START OF SELECTION *
----
START-OF-SELECTION.
*CARREGANDO O ARQUIVO DA ESTAÇÃO DE TRABALHO
PERFORM UPLOAD_FILE USING P_FILE.
*POPULANDO DADOS.
PERFORM POPULATE_FILE.
&----
*& Form HELP_FILE
&----
-
texto
----
-
-->P_P_FILE texto
----
FORM HELP_FILE USING P_P_FILE.
DATA: L_FILE TYPE IBIPPARMS-PATH.
CALL FUNCTION 'F4_FILENAME'
-
EXPORTING
-
PROGRAM_NAME = SYST-CPROG
-
DYNPRO_NUMBER = SYST-DYNNR
-
FIELD_NAME = ' '
IMPORTING
FILE_NAME = L_FILE.
P_P_FILE = L_FILE.