T528 also says PLAN field is missing. (PA40-BATCH). Could you help please?

DATA : BEGIN OF itab OCCURS 0,
        infty TYPE p0001-infty,
        pernr TYPE p0001-pernr,  "per no
        plans TYPE p0001-plans,  "pozisyon
        werks TYPE p0001-werks,  "personel alanı
        persg TYPE p0001-persg,  "çalışan grubu
        persk TYPE p0001-persk,  "çalışan alt grubu
        END OF itab.
DATA it_pprop TYPE pprop OCCURS 0 WITH HEADER LINE.
PARAMETERS p_file TYPE string.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
   CALL METHOD cl_rsan_ut_files=>f4
     EXPORTING
       i_applserv       = space
       i_title          = 'File path...'
       i_gui_extension  = 'TXT'
       i_gui_ext_filter = space
     CHANGING
       c_file_name      = p_file.
START-OF-SELECTION.
   CALL METHOD cl_gui_frontend_services=>gui_upload
     EXPORTING
       filename                = p_file
*    FILETYPE                = 'ASC'
    has_field_separator     = 'X'
*    HEADER_LENGTH           = 0
*    READ_BY_LINE            = 'X'
*    DAT_MODE                = SPACE
*    CODEPAGE                = SPACE
*    IGNORE_CERR             = ABAP_TRUE
*    REPLACEMENT             = '#'
*    VIRUS_SCAN_PROFILE      =
*  IMPORTING
*    FILELENGTH              =
*    HEADER                  =
    CHANGING
      data_tab                = itab[]
  EXCEPTIONS
    file_open_error         = 1
    file_read_error         = 2
    no_batch                = 3
    gui_refuse_filetransfer = 4
    invalid_type            = 5
    no_authority            = 6
    unknown_error           = 7
    bad_data_format         = 8
    header_not_allowed      = 9
    separator_not_allowed   = 10
    header_too_long         = 11
    unknown_dp_error        = 12
    access_denied           = 13
    dp_out_of_memory        = 14
    disk_full               = 15
    dp_timeout              = 16
    not_supported_by_gui    = 17
    error_no_gui            = 18
    OTHERS                  = 19.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
END-OF-SELECTION.
  LOOP AT itab.
    it_pprop-infty = itab-infty.
    it_pprop-fname = 'P0001-PLANS'.
    it_pprop-fval = itab-plans.
    APPEND it_pprop.
    it_pprop-infty = itab-infty.
    it_pprop-fname = 'P0001-WERKS'.
    it_pprop-fval = itab-werks.
    APPEND it_pprop.
    it_pprop-infty = itab-infty.
    it_pprop-fname = 'P0001-PERSG'.
    it_pprop-fval = itab-persg.
    APPEND it_pprop.
    it_pprop-infty = itab-infty.
    it_pprop-fname = 'P0001-PERSK'.
    it_pprop-fval = itab-persk.
    APPEND it_pprop.
    CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
     EXPORTING
       pernr                    = itab-pernr
*   MASSN                    =
       actio                    = 'INS'
       tclas                    = 'A'
*     begda                    = itab-begda
*     endda                    = itab-endda
*   OBJPS                    =
*   SEQNR                    =
*   SPRPS                    =
*     subty                    = itab-subty
     werks                    = itab-werks
     persg                    = itab-persg
     persk                    = itab-persk
     plans                    = itab-plans
       dialog_mode              = '2'
*   LUW_MODE                 = '1'
*   NO_EXISTENCE_CHECK       = ' '
*   NO_ENQUEUE               = ' '
* IMPORTING
*   RETURN                   =
*   RETURN1                  =
*   HR_RETURN                =
      TABLES
        proposed_values          = it_pprop
*   MODIFIED_KEYS            =
  ENDLOOP.

Hi Niel,
For Ex. you have sample data like below.
Info Provider   A   B   C   D   E   KF1     KF2     KF3
Cube A        YZ  PQ RS JK LM (20000) 100
Cube A        AB CD  RS JK LM (60000) 300
Cube B         #    #   RS JK LM                        200
Cube A        AB  CD EF GH UV   (0)     500
Cube B         #    #   OP TV AZ                        200
Figures in Bracket is what we should ideally get on running formula.
Now let me try explain you simulation if we keep only C,D & E Info Objects Only. Heres the statement below.
{KF1,C,D,E,Cube A} = {KF2,C,D,E,Cube A} * {KF3,C,D,E,Cube B}
As A & B Info Objects are also coming through the level, the transaction data is more at granular level. i.e A wise, B wise, C wise, D wise and E wise by which KF2 is getting determined.
Just by keeping C D & E KF2 in above case cannot be derived.
Hence for the above formula KF2 value is 0.
It will never aggregate KF2 to 300 + 100 = 400 and then multiply by 200. Reason being if it does it, it will get a value 400*200 = 80000. Now how will it divide this 80000 into
(YZ  PQ)  &  (AB CD) combination if we dont keep A & B info objects in the FOX. For such dilamma BPS never aggregates key figures on its own. It considers the same granularity level of the key figure as it coming through the level in lead coln. And the granularity level you have kept in FOX and in level is different.
In short, you where trying to calc key figure values at a higher level but data flowing the planning level is more at granular level.
Hope this clarifys.
Thanks,
Mihir

Similar Messages

Maybe you are looking for