[SAP] – Set Automatic Value Infotype 8 (Suggest value infotype 8) | ABAP-HR

Kadangkala, dalam mendevelop Payroll System, user mengharapkan suggestion value pada system untuk memudahkan kinerjanya (suggestion value berdasarkan rumus pada perusahaan tersebut). Pada tulisan ini tidak menitikberatkan menunjukkan formula perhitungan (yang pasti berbeda-beda pada setiap company dan sangat rahasia, melainkan bagaimana cara mentriggernya dan cara untuk meng-set valuenya.

1.Set enhancement in the ‘cmod’ tcode 

2. Code

“============================= 

*&——-main process 
CHECK innnn-infty = ’0008′. 

“============================= 

CALL FUNCTION ’HR_READ_INFOTYPE’   “read data infotype 1 
  EXPORTING 
    tclas     = ’A’ 
    pernr     = innnn-pernr 
    infty       = ’0001′ 
    begda     = innnn-begda 
    endda     = innnn-endda 
  TABLES 
    infty_tab = i0001. 

“============================= 

CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn “==> get infotype 8 (sebagai source) 
  EXPORTING 
    prelp = innnn 
  IMPORTING 
    pnnnn = i0008. 
 
lv_datum = i0008-begda. “sy-datum. 
 
ASSIGN i0008 TO <fs_i0008>. 

“============================== 

DO 40 TIMES.  “dilakukan pengulangan 40x, karena pada structure infotype 8 value disimpan pada 40 field. 

CONCATENATE ’BET’ lv_index_c INTO lv_bet.   “declare untuk mengambil value field BETXX 
  CONCATENATE ’LGA’ lv_index_c INTO lv_lga.   “declare untuk mengambil value field LGAXX 
  IF <fs_i0008> IS ASSIGNED. 
“=============================== 

<fs_valbt> = VALUE “nilai suggestion diset disini 

ENDDO. 

“============================== 

*&——- update invotype 8
CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp 
  EXPORTING 
    pnnnn = i0008 
  IMPORTING 
    prelp = innnn. 
 
IF sy-ucomm NE ’UPD’. 
  show_data_again = ’X’.   “ditampilkan pada layout screen 
ENDIF.

3. Testing

Sistem dapat memberikan saran pada PA30 Infotype 8 sesuai dengan hasil perhitungan.

a. Process

b. Result display setelah enter

DONE

Demikian sharing terkait suggestion pada infotype 8, sesuai dengan rumus yang berlaku. Jadi user tidak perlu memasukkan nilainya berapa, namun cukup dengan memasukkan WT nya, lalu enter, semoga tulisan ini dapat bermanfaat dan membantu.
Jika ada yang perlu didiskusikan, please contact me at : yudho.guritno@gmail.com

_TerimaKasih,
GuritnoY
https://www.linkedin.com/in/guritno-yudho-wibowo-95944236/

You may also like...

25 Responses

  1. How good that we managed to find such a wonderful blog, and all the more excellent that there are such sensible authors!

  2. There is something in this. Thank you very much for the information. You were right.

  3. Zer good I put 5 points.

  4. John says:

    Like your explaining, and the look like its detail, but i must open the translate for read youre blog. I feel better you serve English language into youre blog.
    But this is no worry

  5. Oil Folex says:

    Great, this is funny information

  6. mail7.net says:

    Awesome! Thanks!!!

  7. It is very comforting to see that others are suffering from the same problem as you, wow!

  8. sightcare says:

    Thanks for thr great article!

  9. boostaro says:

    It is very comforting to see that others are suffering from the same problem as you, wow!

  10. sight care says:

    Thank you so much!

  11. vega 100 mg says:

    Thank you so much!

  12. viagra hap says:

    It is very comforting to see that others are suffering from the same problem as you, wow!

  13. heart tonik says:

    Thank you so much!

  14. Thanks for thr great article!

  15. Thanks for thr great article!

  16. immediate says:

    Thanks for thr great article!

  17. KAYSWELL says:

    Of course, what a magnificent site and instructive posts, I surely will bookmark your website.Best Regards!

  18. Thanks for thr great article!

  19. sight care says:

    Thank you so much!

Leave a Reply

Your email address will not be published. Required fields are marked *