Quantcast
Channel: SCN: Message List - ABAP Connectivity
Viewing all articles
Browse latest Browse all 3125

Re: RH_OM_ATTRIBUTES_UPDATE Error in sap abap

$
0
0

Hi Kalpana,

 

 

These Infotypes are different compated to 1000 ,

 

So you can use RH_INSERT_INFTY to update IT1222 These IT contains TABNR fields which needs to be updated.

 

Use the code and change the FM I am giving the code for IT1017 and use change it to IT1222.

 

TABLES pppar.

 

DATA : ptsub LIKE t777d-ptnnnn VALUE 'PT1017'.

DATA : pt_tabnr LIKE d021t-fldn VALUE 'P1017-TABNR'.

 

DATA: %upd_repid LIKE sy-repid,

       %upd_form TYPE edperform.

DATA : tdata_sort LIKE t77cd-tdata_sort VALUE ' '.

DATA: fcode_for_insert LIKE hrrhap-fcode.

 

CONSTANTS: tabnr_fdname LIKE dfies-fieldname VALUE '-TABNR'.

CONSTANTS:      def_vtask_space  LIKE hrrhap-vtask VALUE ' ',

                 def_commit_flg_no LIKE hrrhap-commit_flg VALUE ' ',

                 def_authy_no LIKE hrrhap-authy VALUE 'X'.

 

DATA: BEGIN OF dyn_tab OCCURS 1,

         vdata LIKE pplog-vdata,

         opera(1),

       END OF dyn_tab.

 

FIELD-SYMBOLS : <ptsub>, <pttabnr>,

                 <ptsub_char> TYPE any.

 

pppar-fcode =   'INSE'.

pppar-listb =   '0'.

pppar-break =   '0'.

pppar-cycle =   '0'.

pppar-updat =   '1'.

pppar-clear =   '1'.

pppar-timco =   '2'.

pppar-vtask =   'D'.

pppar-enque =   '1'.

pppar-langu =   '1'.

pppar-pstat =   'INSE'.

pppar-ppnnn =   'P1017'.

pppar-edynr =   '2000'.

pppar-ldynr =   '3000'.

pppar-lvdat =   '000'.

pppar-lpsub =   '000'.

pppar-dialg =   'RH_INFOTYP_1017'.

pppar-repid =   'MP101700'.

pppar-dvary =   'INSE'.

pppar-dbtab =   'HRP1017'.

pppar-tbtab =   'HRT1017'.

pppar-ptnnnn  =   'PT1017'.



pplog_tab-mandt =   '800'.

pplog_tab-plvar =   '01'.

pplog_tab-otype =   'S'.

pplog_tab-objid =   '50013077'.

pplog_tab-infty =   '1017'.

pplog_tab-istat =   '1'.

pplog_tab-begda =   sy-datum.

pplog_tab-endda =   '99991231'.

pplog_tab-varyf =   'E'.

pplog_tab-seqnr     = '000'.

pplog_tab-aedtm sy-datum.

pplog_tab-uname sy-uname.

pplog_tab-itxnr =   '00000000'.

APPEND pplog_tab.


CALL FUNCTION 'RH_INSERT_INFTY'

   EXPORTING

     fcode               = 'INSE'

     vtask               = 'B'

*   ORDER_FLG           = 'X'

*   COMMIT_FLG          = 'X'

*   AUTHY               = 'X'

*   PPPAR_IMP           =

*   OLD_TABNR           = ' '

     repid               = sy-repid

     form                = '%TAB_DB'

*   KEEP_LUPD           =

*   WORKF_ACTV          = 'X'

   TABLES

     innnn               = pplog_tab[]

*   ILFCODE             =

   EXCEPTIONS

     no_authorization    = 1

     error_during_insert = 2

     repid_form_initial  = 3

     corr_exit           = 4

     begda_greater_endda = 5

     OTHERS              = 6.

IF sy-subrc <> 0.

* Implement suitable error handling here

ELSE.

   CALL FUNCTION 'RH_UPDATE_DATABASE'

     EXPORTING

       vtask     = 'D'

     EXCEPTIONS

       corr_exit = 1

       OTHERS    = 2.

   COMMIT WORK.

ENDIF.



Copy and paste the below code and don't change.this one and update Attribute Value from , Value To , Default & Exclude values.


form %tab_db tables %td_tab

              using  %td_set

                     %td_tabix.

   data: %td_tab_count type p.

   field-symbols: <%td_tab_char> type any.                 "ANDUNI

 

   assign %td_tab to <%td_tab_char> casting type c.        "ANDUNI

   refresh %td_tab.

   loop at dyn_tab.

*    <ptsub> = dyn_tab.

*    %td_tab = <ptsub>.

     <ptsub_char> = dyn_tab.                               "ANDUNI

     <%td_tab_char> = <ptsub_char>.                        "ANDUNI

     append %td_tab.

   endloop.

   describe table %td_tab lines %td_tab_count.

   if %td_tab_count = 0.

*   leere Tabelle => Kopfzeile clearen

     clear <ptsub>.

*    %td_tab = <ptsub>.                                   "ANDUNI

     <%td_tab_char> = <ptsub_char>.                        "ANDUNI

   endif.

   if tdata_sort ne space.

     sort %td_tab.

   endif.

endform.




I hope this will be helpful.




Thanks & Reagrds,

Raghunadh Kodali.


Viewing all articles
Browse latest Browse all 3125

Trending Articles