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 Batch Input

former_member384574
Active Participant
0 Likes
2,297

Good morning to everybody!

I've a problem with my Batch Input, I have to create the batch input after the data are choosen in the previous ALV but when I tried this i received the following message "BDC_INSERT, dynpro .&. no válido."

This is my code, does anybody know why this is happend?

FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.

CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
* EXPORTING
*   IR_SALV_FULLSCREEN_ADAPTER       =
 IMPORTING
*   ET_EXCLUDING                     =
*   E_REPID                          =
*   E_CALLBACK_PROGRAM               =
*   E_CALLBACK_ROUTINE               =
   E_GRID                           = ref1.
*   ET_FIELDCAT_LVC                  =
*   ER_TRACE                         =
*   E_FLG_NO_HTML                    =
*   ES_LAYOUT_KKBLO                  =
*   ES_SEL_HIDE                      =
*   ET_EVENT_EXIT                    =
*   ER_FORM_TOL                      =
*   ER_FORM_EOL                      =

call method ref1->check_changed_data.

 loop at itab_tabla INTO wa_tabla  where chk = 'X'.
    valid = 'X'.
    exit.
  endloop.

  CASE R_UCOMM.
    WHEN '&BI'.

    CALL FUNCTION 'POPUP_TO_CONFIRM'
      EXPORTING
       TITLEBAR                    = 'Ventana de confirmación'
*       DIAGNOSE_OBJECT             = ' '
        TEXT_QUESTION               = '¿Está seguro de querer ejecutar la carga de datos?'
       TEXT_BUTTON_1               = 'Yes'
*       ICON_BUTTON_1               = 'No '
       TEXT_BUTTON_2               = 'No'
*       ICON_BUTTON_2               = ' '
       DEFAULT_BUTTON              = '1'
*       DISPLAY_CANCEL_BUTTON       = 'X'
*       USERDEFINED_F1_HELP         = ' '
       START_COLUMN                = 25
       START_ROW                   = 6
*       POPUP_TYPE                  =
*       IV_QUICKINFO_BUTTON_1       = ' '
*       IV_QUICKINFO_BUTTON_2       = ' '
     IMPORTING
       ANSWER                      = answer.
*     TABLES
*       PARAMETER                   =
*     EXCEPTIONS
*       TEXT_NOT_FOUND              = 1
*       OTHERS                      = 2
              .

      IF answer = '1'.

       perform ejecutarBI.
     ENDIF.



    IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

****  LOOP AT ITAB_TABLA INTO wa_tabla WHERE CHK = 'X'.
****    wa_tabla-CHK = 'X'.
****
****    MODIFY ITAB_TABLA FROM WA_TABLA TRANSPORTING CHK WHERE PERID = wa_tabla-PERID .
****  ENDLOOP.
****
****
****        PERFORM ejecutarBI.
 ENDCASE.




*&---------------------------------------------------------------------*
*&      Form Ejecutar BI
*&---------------------------------------------------------------------*

FORM EJECUTARBI.


CALL FUNCTION 'BDC_OPEN_GROUP'
 EXPORTING
   CLIENT                    = SY-MANDT
*   DEST                      = FILLER8
   GROUP                     =  'PRUEBA'
*   HOLDDATE                  = FILLER8
*   KEEP                      = FILLER1
   USER                      =  'RREOL'
*   RECORD                    = FILLER1
*   PROG                      = SY-CPROG
*   DCPFM                     = '%'
*   DATFM                     = '%'
* IMPORTING
*   QID                       =
* EXCEPTIONS
*   CLIENT_INVALID            = 1
*   DESTINATION_INVALID       = 2
*   GROUP_INVALID             = 3
*   GROUP_IS_LOCKED           = 4
*   HOLDDATE_INVALID          = 5
*   INTERNAL_ERROR            = 6
*   QUEUE_ERROR               = 7
*   RUNNING                   = 8
*   SYSTEM_LOCK_ERROR         = 9
*   USER_INVALID              = 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.



* Ventana 1000

LOOP at itab_tabla INto wa_tabla.

  PERFORM BDC_DYNPRO      USING 'SAPMP50A' '1000'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE' '=INS'.
  PERFORM BDC_FIELD       USING 'RP50G-PERNR' wa_tabla-PERNR.
  PERFORM BDC_FIELD       USING 'RP50G-CHOIC' '15'.

* Ventana Infotipo 0015 con simulacion de ENTER

  PERFORM BDC_DYNPRO      USING 'MP001500' '2000'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                 'Q0015-BETRG'.

*  PERFORM BDC_FIELD       USING 'P0015-BEGDA' BEGDA.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE' '=UPD'.

  PERFORM BDC_FIELD       USING 'P0015-LGART' '9998'. " Insertamos el total de la prorrata en el concepto de nómina 9998
*  PERFORM BDC_FIELD       USING 'P001-ENDDA' RECORD-ENDDA.

ENDLOOP.



CALL FUNCTION 'BDC_INSERT'
 EXPORTING
   TCODE                  = 'PA30'
*   POST_LOCAL             = NOVBLOCAL
*   PRINTING               = NOPRINT
*   SIMUBATCH              = ' '
*   CTUPARAMS              = ' '
  TABLES
    DYNPROTAB              = BDC_TAB
* EXCEPTIONS
*   INTERNAL_ERROR         = 1
*   NOT_OPEN               = 2
*   QUEUE_ERROR            = 3
*   TCODE_INVALID          = 4
*   PRINTING_INVALID       = 5
*   POSTING_INVALID        = 6
*   OTHERS                 = 7
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.




CALL FUNCTION 'BDC_CLOSE_GROUP'
* EXCEPTIONS
*   NOT_OPEN          = 1
*   QUEUE_ERROR       = 2
*   OTHERS            = 3
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

ENDFORM.                    "EjecutarBI

14 REPLIES 14
Read only

Former Member
0 Likes
2,053

The problem is with the BDC , and why can't you use the the Function

HR_INFOTYPE_OPERATION for updating, why are you going for BDC, any sepecific reason..

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

CLIENT = SY-MANDT

GROUP = 'PRUEBA'

USER = 'RREOL'

  • EXCEPTIONS

  • CLIENT_INVALID = 1

  • DESTINATION_INVALID = 2

  • GROUP_INVALID = 3

  • GROUP_IS_LOCKED = 4

  • HOLDDATE_INVALID = 5

  • INTERNAL_ERROR = 6

  • QUEUE_ERROR = 7

  • RUNNING = 8

  • SYSTEM_LOCK_ERROR = 9

  • USER_INVALID = 10

  • OTHERS = 11

.

IF SY-SUBRC NE 0.

"Check first this Function OPen group success or failure.

"then only insert othter wise you get the problems..

ENDIF.

Read only

0 Likes
2,053

Because I've to create the BDC_Data for after insert it into the BI, the function 'HR_INFOTYPE_OPERATION' I don't know how to use and I have to create the Batch Input before the data are inserted into the transacction PA30.... infotype 0015...

Read only

0 Likes
2,053

any way , keep the break point and BDC_OPEN_GROUP function call and check what is happening exactly.

if Open Function fails , Insert Function will fail.

Call function 'BDC_OPEN_GROUP'..

if sy-subrc eq 0.
call Function 'BDC_INSERT_GROUP'...

...

endif.

what is the message number and id for the message you are getting.

Read only

0 Likes
2,053

The number of the message I received is this:

BDC_INSERT, dynpro .&. no válido.

Nº mensaje: 00339

Diagnóstico

Error al crear un juego de datos batch input.

Procedimiento

Informar al responsable.

I can't create my data group, and I don't know why, the code is the same code of a report that make the same without the ALV before... can anybody help me? please!!

Thanks a lot!

Read only

0 Likes
2,053

Translate:

Error al crear un juego de datos batch input.


Procedimiento

Informar al responsable.

Amit.

Read only

0 Likes
2,053

Sorry, I'm spanish and I forgot to transalte that, sorry a lot. Now I have changed the order of the code and now, I can see in SM35 the Batch Input but this doesn't have nothing, this is the new code... now i don't received any message...

FORM EJECUTARBI.


CALL FUNCTION 'BDC_OPEN_GROUP'
 EXPORTING
   CLIENT                    = SY-MANDT
*   DEST                      = FILLER8
   GROUP                     =  'PRUEBA'
*   HOLDDATE                  = FILLER8
*   KEEP                      = FILLER1
   USER                      =  'RREOL'
*   RECORD                    = FILLER1
*   PROG                      = SY-CPROG
*   DCPFM                     = '%'
*   DATFM                     = '%'
* IMPORTING
*   QID                       =
* EXCEPTIONS
*   CLIENT_INVALID            = 1
*   DESTINATION_INVALID       = 2
*   GROUP_INVALID             = 3
*   GROUP_IS_LOCKED           = 4
*   HOLDDATE_INVALID          = 5
*   INTERNAL_ERROR            = 6
*   QUEUE_ERROR               = 7
*   RUNNING                   = 8
*   SYSTEM_LOCK_ERROR         = 9
*   USER_INVALID              = 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.




* Ventana 1000

LOOP at itab_tabla INto wa_tabla.


  PERFORM BDC_DYNPRO      USING 'SAPMP50A' '1000'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE' '/00'.
  PERFORM BDC_FIELD       USING 'RP50G-PERNR' wa_tabla-PERNR.
  PERFORM BDC_FIELD       USING 'RP50G-CHOIC' '15'.


  PERFORM BDC_DYNPRO      USING 'SAPMP50A' '1000'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE' '=INS'.
  PERFORM BDC_FIELD       USING 'RP50G-PERNR' wa_tabla-PERNR.
  PERFORM BDC_FIELD       USING 'RP50G-CHOIC' '15'.

* Ventana Infotipo 0015 con simulacion de ENTER

  PERFORM BDC_DYNPRO      USING 'MP001500' '2000'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                 'Q0015-BETRG'.

*  PERFORM BDC_FIELD       USING 'P0015-BEGDA' BEGDA.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE' 'UPD'.

  PERFORM BDC_FIELD       USING 'P0015-LGART' wa_tabla-CINCO. " Insertamos el total de la prorrata en el concepto de nómina 9998
*  PERFORM BDC_FIELD       USING 'P001-ENDDA'  wa_tabla-betrg.

ENDLOOP.



CALL FUNCTION 'BDC_INSERT'
 EXPORTING
   TCODE                  = 'PA30'
*   POST_LOCAL             = NOVBLOCAL
*   PRINTING               = NOPRINT
*   SIMUBATCH              = ' '
*   CTUPARAMS              = ' '
  TABLES
    DYNPROTAB              = BDC_TAB
* EXCEPTIONS
*   INTERNAL_ERROR         = 1
*   NOT_OPEN               = 2
*   QUEUE_ERROR            = 3
*   TCODE_INVALID          = 4
*   PRINTING_INVALID       = 5
*   POSTING_INVALID        = 6
*   OTHERS                 = 7
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

ENDIF.




CALL FUNCTION 'BDC_CLOSE_GROUP'
* EXCEPTIONS
*   NOT_OPEN          = 1
*   QUEUE_ERROR       = 2
*   OTHERS            = 3
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

ENDFORM.                    "EjecutarBI

Read only

0 Likes
2,053

Check you have populated BDC_TAB.

Do you have any records in BDC_TAB.

CALL FUNCTION 'BDC_INSERT'
 EXPORTING
   TCODE                  = 'PA30'
*   POST_LOCAL             = NOVBLOCAL
*   PRINTING               = NOPRINT
*   SIMUBATCH              = ' '
*   CTUPARAMS              = ' '
  TABLES
    DYNPROTAB              = BDC_TAB
* EXCEPTIONS
*   INTERNAL_ERROR         = 1
*   NOT_OPEN               = 2
*   QUEUE_ERROR            = 3
*   TCODE_INVALID          = 4
*   PRINTING_INVALID       = 5
*   POSTING_INVALID        = 6
*   OTHERS                 = 7
          .
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
2,053

Yes I have data in the BDC data...now I received the same message,

BDC_INSERT, dynpro .&. no válido.

Nº mensaje: 00339

Diagnóstico

Error al crear un juego de datos batch input.

Error where creating the data for the Batch Input

Procedimiento

Informar al responsable.

Inform to the person in charge.

Read only

0 Likes
2,053

Redeca,

Vijay wrote:The problem is with the BDC , and why can't you use the the Function

HR_INFOTYPE_OPERATION for updating

He is Absolutely right.

BDC for PA30 never prefferd.i think you can achieve all goal for HR master data from HR_INFOTYPE_OPERATION.

either use PA40.

this is how you should use:

CALL FUNCTION 'HR_INFOTYPE_OPERATION'
     EXPORTING
          INFTY         = '0008'"0015 in your case and fill data accordingly
          NUMBER        = EMPLOYEENUMBER
          SUBTYPE       = SUBTYPE
          VALIDITYEND   = VALIDITYEND
          VALIDITYBEGIN = VALIDITYBEGIN
          RECORD        = P0008
          OPERATION     = CHECK_RECORD
    IMPORTING
          RETURN        = RETURN
          KEY           = PERSONALDATAKEY
     EXCEPTIONS
          OTHERS        = 0.

Amit.

Edited by: Amit Gujargoud on Aug 21, 2008 12:56 PM

Edited by: Amit Gujargoud on Aug 21, 2008 12:56 PM

Read only

0 Likes
2,053

What should I put in the parameter operation of the function HR_INFOTYPE_OPERATION ?

Read only

0 Likes
2,053

Rebeca,

see these are the possible option we can give in OPRATION:

COP	Copy
DEL	Delete
DIS	Display
EDQ	Lock/unlock
INS	Create
LIS9	Delimit
MOD	Change
INSS	Create for Actions is not converted to Change

choose either accordinf to your requirement.

Amit.

Read only

0 Likes
2,053

Sorry for all the questions, now I have delete the funciton "BDC_OPEN_GROUP" and now, when I tried to insert the data with the function HR_INFOTYPE_OPERATION when I execute the message I received is "The data group is not open" please...can you give me any example?

Thanks for all your help!

Thanksa lot

Regards

Read only

0 Likes
2,053

when you are using the Function HR_INFOTYPE_OPERATION you don't need to call any BDC realted functions insert or close.

So remove those functions and use only HR_INFOTYPE_OPERATION and if you want to use this function module you have to lock the PERNR before calling the FUnction.

call function 'BAPI_EMPLOYEE_ENQUEUE'
       exporting
            number = p0002-pernr
       importing
            return = return_struc.
      ....

    call function 'HR_INFOTYPE_OPERATION'
      exporting
        infty                  = '0002'
        number                 = p0002-pernr
        validityend            = p0002-endda
        validitybegin          = p0002-begda
        recordnumber           = p0002-seqnr
        record                 = p0002
        operation              = 'MOD'
        dialog_mode            = '1'
      importing
        return                 = return_struc
        key                    = record_key.

    if not return_struc is initial.
   
    endif.
   ......
  call function 'BAPI_EMPLOYEE_DEQUEUE'
       exporting
            number = p0002-pernr.

Read only

Former Member
0 Likes
2,053

Hi all, I have another problem with Batch input map creating. I process some data internal table for modification in infotype using FM HR_INFOTYPE_OPERATION and when some error appeared I should this record save in batch input map. This map will be processed manually in SM35 after run this report.

BDC_OPEN_GROUP.

LOOP AT IT_TABLE.

CALL FUNCTION HR_INFOTYPE_OPERATION.(modify)

IF error from FM.

REFRESH it_bim.

PERFORM fill_it_bim.

BDC_INSERT using it_bim.(create map for manually process in SM35)

ENDIF.

ENDLOOP.

BDC_CLOSE_GROUP.

BDC_OPEN_GROUP = sy-subrc EQ 0.

BDC_INSERT = sy-subrc EQ 0.

All is ok but when two records are processed and should be closed those session an error queue error raising and I do not why. 1 record in it_table processed successfully and 2 records not. Please help me anyone. Thnx.