Page 3 of 5

Create Tcode from Query

> SE93
> Start Object Choose Transaction with Parameters

> Then on bottom of screen, fill this inside table

D_SREPOVARI-REPORTTYPE AQ
D_SREPOVARI-EXTDREPORT F2
D_SREPOVARI-REPORT 02

Explanation:

Value ‘AQ’ is for Report Type Query
Value ‘F2′ is for Name of Query
Value ’02’ is for User Group

Count Entries in Internal Table

In the middle of coding, I need logic to count the specific entries inside a internal table.
Instead of looping per cycle then saving it into counter variable, I found a better way to achieve that.

LOOP AT itab
TRANSPORTING NO FIELDS WHERE aubel = itab-aubel.
        add 1 to lv_vbeln_counter.
ENDLOOP. 

source: link

PFCG Create Authorization – part 1 (Restricting TCode)

PFCG is transaction on SAP that used for configuring role for user. Why would role is important for user on SAP?
This role is invented by SAP to restricting user for accessing the unwanted tcode. For example we don’t want the user have access for SU01 for creating user or change the other user password. Another example, we don’t want the user to access the classified report (maybe like salary report of a your company).etc.

Without further ado.
1. Go To Tcode PFCG
2. Input name then click single role
3. fill in description
4. Then click menu on tab strip
5. Click icon with label ‘transaction’

6. Input tcode that accessible for this role.

7. If green light active on menu tab strip then go to next tab, authorization

8. Click icon ‘propose profile name’ to automatically generate profile name.
This profile name will be used for specific roled user.

9. Then click Change Authorization Data
10. In the new screen, then open the top of tree ‘Cross-application Authorization Objects’
it means that the role is going to check whether the user with this profile are authorize to access the tcode.
In this example the user with this profile only allowed to access tcode SE11, SE19, SE24, SE37, SE38, SE80

11. Click the circle icon with red & white color, then back.
12. We can see the authorization tab strip in green light. if not u need to regenerate the authorization data.
13. Then go to user tab strip
14. Input user you want to give the role. save.
15. Go to Tcode su01, make sure the role on user on a green light icon.
if not then delete the role. input the role name. save.

16. To test the role is working go to registered tcode first in my case SE11, SE19, SE24, SE37, SE38, SE80 with the user with role. The code should be accesible to user.
17. Check the other tcode registered (ne SE11, SE19, SE24, SE37, SE38, SE80).
18. Voila!

SAP will trigger the error message that the user are not authorized for the tcode.

Read Selection Screen Value

This problem I found when I need to read the selection screen from exit I made inside zsearchhelp.
The value on selection screen are not readable from exit program.
Instead of exporting using memory or passing with field symbol, I found a Function Module to accommodate to read the selection screen value.


CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
    EXPORTING
      curr_report     = sy-cprog
    TABLES
      selection_table = lt_param
    EXCEPTIONS
      not_found       = 1
      no_report       = 2
      OTHERS          = 3.
  IF sy-subrc <> 0.
* Implement suitable error handling here
  ENDIF.

Strikethrough on Smartforms

On this post I will show you how to make a strikethrough on a smartforms just like image below.

> Go to smartstyles
> Create new node on Character Format
> Tick underlined
> Click Multiple Selection
> Input Spacing with minus value.
The value is minus because we need the underlined to go upper the word.

Selection Screen to Table Maintenance View

Last day, I have a requirement to restrict the data that appear using input from selection screen. But, the data that will be restricted is come from table maintenance screen. Instead of showing all the data on ztable by calling the screen generated by table maintenance generator, input from selection screen restricted the data that appear.

How do we achieve that?

1. Determine input, Select Option or Parameter.
We need to define whether the input come from Select Option or Parameter.

CLEAR: selection.
  REFRESH: selections.

  DEFINE addsel.
    CALL FUNCTION 'VIEW_RANGETAB_TO_SELLIST'
      EXPORTING
        fieldname          = &1
        append_conjunction = 'AND'
      TABLES
        sellist            = selections
        rangetab           = &2[].
  END-OF-DEFINITION.

  DEFINE addparam.
    IF &2 IS NOT INITIAL.
      CLEAR selection.
      selection-viewfield = &1.
      selection-value = &2.
      selection-and_or = 'AND'.
      selection-operator = 'EQ'.
      APPEND selection TO selections.
    ENDIF.
  END-OF-DEFINITION.

at this selection you can define wheter to use logic ‘and’ or ‘or’ for selection.

2. Fill macro Select Option and Parameter

You can define input for select option or paramter from macro defined. In this case, I only use parameter.

addparam 'VKORG' p_sorg.
addparam 'FP_YEAR' p_year.

3. Call Function ‘VIEW_MAINTENANCE_CALL’.

CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
    EXPORTING
      action                = 'U' "for Update
      view_name             = 'ZTA_SD_MFP'
      complex_selconds_used = 'X'
    TABLES
      dba_sellist           = selections
    EXCEPTIONS
      OTHERS                = 1.
  IF sy-subrc = 1.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

Here is the preview of my program,

> Table contain multiple data

>Pop-Up Selection Screen

>Table with Restricted data from Selection Screen

Source of Knowledge:
http://scn.sap.com/docs/DOC-45561

Bug – Document Number Created Only When Debug Mode

Yesterday, there is a PM functional reporting bug to me. One of my program somehow didn’t work anymore. It is supposed to be created Document Number using BAPI.

Then I put a break point inside the code, the program run well and the Document Number created. I tried with different scenario with break point still active, Document Number created. Strange.
I tried with different user without a break point Document Number not created. Hmm..
I tried with another different user without a break point Document Number also not created.
Document number only created when program enter debugging mode.

At this point I try to sleep to clear all of the possibilities that could ever happen.

I’ve ever happened like this before, but the problem with BAPI.
I put syntax ‘wait up to’ for each BAPI or before BAPI commit. I tried with the same approach, no result.
Clearing the MEMORY ID neither is worked.
We check the authorization SU53, everything is fine.
Deadlock.

So this early morning my senior give me sudden epiphany.

We know that ‘select’ is a syntax that use in database to collect the data stored. Somehow in SAP the traffic into database sometimes got crowded, so some command queuing until executed by database.
We take a look on program standard. Where I put the BAPI.

There is a enqueue process.

So with the same approach like ‘waiting up to x seconds’, we try to wait until the document created on SAP table.

WHILE gw_imrg IS INITIAL.

    SELECT SINGLE mdocm INTO gw_imrg FROM imrg
      WHERE mdocm = p_mdocm.

    WAIT UP TO 1 SECONDS.

  ENDWHILE.

Voila!

MM – Copy Reference PO

Why do I need to write this down?
As a ABAP sometimes we need to test the transaction in countless time. And in specific cases we need to deal with standard program which we don’t know the flow yet.
If you could cancel the document number or transaction is it okay if you have one, but there also cases where transaction are cannot be canceled.

With the help of a friend I need to make some PO, so he telling me in short of way.
So here is the step by step.

1. Go to Tcode ME21n
2. Document Overview
3. Click Selection Invariant (red, yellow, blue icon)
4. Choose Purchase Order from drop down
5. Execute
6. Screen will be back to ME21N screen
7. Click Purchase Doc
8. Click Adopt
9. Save
10. New duplicate Purchase Order number created on message.

Generate Notification from Measurement Reading

Last week I have this requirement from PM module to generate notification (IW28) from measurement reading. This requirement trigger from save button on tcode IK11 or IK22.

At first I was told by functional to use user exit on IMRC0001 with function module EXIT_SAPLIMR0_001. But somehow, the BAPI is not working, dump with ‘type_message_x’ error. The 001 exit is used on save-event. I try to move the code into another exit which is ..004 the BAPI is working. I guess the problem occur because of transaction already using commit whenever save-event but then the BAPI try using it again. Then I move the code another place before the measurement document created, the moment before commit. The BAPI works like a charm. And the notification created succesfully.

Whenever measurement reading are outside range of measuring point program will automatic generate notification. The measurement reading refers to measuring point that could be access on tcode IK03.
Input Measuring Point > Click Additional Data > Upper-Lower Limit Showed.

We use BAPI to create notification on IW28. Below are snippet code sequence of BAPI.


gw_notifheader-short_text = lv_stext.
        gw_notifheader-priority = '1'.
*gw_notifheader-reportedby = imrg_ins-readr.
        gw_notifheader-reportedby = gw_imrg-readr.
        gw_notifheader-notif_date = sy-datum.

        CALL FUNCTION 'BAPI_ALM_NOTIF_CREATE'
          EXPORTING
*           EXTERNAL_NUMBER    =
            notif_type         = 'M2'
            notifheader        = gw_notifheader
*           TASK_DETERMINATION = ' '
*           SENDER             =
*           ORDERID            =
*           IV_DONT_CHK_MANDATORY_PARTNER       =
*           NOTIFCATION_COPY   =
*           DOCUMENT_ASSIGN_COPY                = ' '
          IMPORTING
            notifheader_export = gw_notifheader_exp.
* TABLES
*   NOTITEM     =
*   NOTIFCAUS   =
*   NOTIFACTV   =
*   NOTIFTASK   =
*   NOTIFPARTNR =
*   LONGTEXTS   =
*   KEY_RELATIONSHIPS                   =
*   RETURN      =
        .

        CALL FUNCTION 'BAPI_ALM_NOTIF_SAVE'
          EXPORTING
            number      = gw_notifheader_exp-notif_no
*           TOGETHER_WITH_ORDER       = ' '
          IMPORTING
            notifheader = gw_notifheader_res
*  TABLES
*           return      = .
          .

        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = 'X'
* IMPORTING
*           RETURN        =
          . 

For note,
IK11 is tcode for creating single measurement document and IK22 for creating multiple measurement document. There is no problem when using one measurement point, but when dealing with multiple measuring point like IK22 you need to determine which measuring point are not initial. What I meant is try accessing IK22 then click ‘All Measuring Point Object’. Then all measuring point showed. If you dont get the right table to be pass over the transaction, The BAPI will create notification for initial measuring reading.

So which is the right table? the clue is IMRG_BUF. All you need is to find the right spot before the table is clear.

[Blog] Eksperimen Jatuh Cinta

Minggu lalu, saat jadwal rutin pulang(baca:pacaran) saya kerumah untuk melepas penat setelah sebulan bekerja di ibukota. Saya sedang menghabiskan waktu dengan membaca-baca artikel didalam flipboard sebelum apel ke rumah pacar. Sampai akhirnya tiba di salah satu artikel yang menarik.

http://www.nytimes.com/2015/01/11/fashion/modern-love-to-fall-in-love-with-anyone-do-this.html

Artikel di New York Times tersebut menceritakan bahwa beberapa tahun yang lalu terdapat seorang Psikologis bernama Arthur Aron. Beliau melakukan eksperimen terhadap beberapa pasang ‘Stranger’, pria dan wanita, untuk melakukan sesi saling tanya mengenai beberapa pertanyaan yang bersifat personal. Pertanyaan-pertanyaan tersebut telah di-setting untuk mempercepat keintiman antara satu sama lain. Dalam eksperimenya terdapat sepasang ‘Stranger’ yang terbukti saling jatuh cinta dan mereka menikah 6 bulan setelah experiment tersebut.

Setelah browsing lebih lanjut tentang eksperimen tersebut, ternyata memang terdapat paper tentang eksperimen jatuh cinta ini. Kalo mau membaca lebih detail tentang penelitian ini bisa baca papernya di http://www.stafforini.com/txt/Aron%20et%20al%20-%20The%20experimental%20generation%20of%20interpersonal%20closeness.pdf

Kemudian di akhir-akhir paper tersebut ada 36 pertanyaan yang digunakan dalam eksperimen tersebut. Baru membaca satu dua pertanyaan Saya berfikir untuk melakukan eksperimen tersebut terhadap pacar Saya sendiri. Instead of doing this to a total stranger, I’m doing the experiment to a person that’s know me so well.
Iya betul, pacar Saya jadikan kelinci percobaan saya sendiri.
Singkat cerita, setelah menceritakan tentang penelitian ini ke pacar, dia juga tertarik untuk melakukan eksperimen tersebut. Karena saat itu kita sedang berada di Gramedia (tempat pacaran favorit kita berdua), akhirnya kita memutuskan untuk mencari tempat ngobrol. Akhirnya kita berdua menjatuhkan pilihan di Dunkin Donut yang terdapat di lantai bawahnya. Gak menjatuhkan pilihan juga sih karena yang deket cuma itu, mau keluar keluar lagi males plus ribet.

Pertanyaan-pertanyaan dalam eksperimen tersebut terdiri dari 36 pertanyaan yang dibagi menjadi 3 set. Tiap pertanyaan dijawab masing-masing, seolah-olah kita bertanya terhadap pasangan kita dan kita menjawab pertanyaan itu sendiri.

Selama di Dunkin kami berdua hanya mampu menyelesaikan satu set dari tiga set yang ada. Saya dan pacar saya mencoba menjawab bergantian siapa yang duluan menjawab. Pertama giliran saya yang menjawab dulu kemudian untuk pertanyaan kedua dia yang menjawab duluan. Setiap pertanyaan yang ada di sesi pertama masih biasa-biasa saja. Bukan biasa-biasa juga sih.
Oke saya ralat. Pertanyaan di sesi pertama ini bisa adalah jenis-jenis pertanyaan yang kebanyakan sudah kita ketahui jawabanya kalo kita sudah mengenal orang tersebut. Atau jenis-jenis pertanyaan yang sebelumnya sudah pernah kita tanyakan kepada pasangan baik secara sadar ataupun tidak.

Mengingat waktu yang hampir malam, gak malam juga sih belum jam 8, pacar saya dipingit soalnya. Akhirnya kami melanjutkan sesi selanjutnya dirumahnya.
Sesampainya dirumah, kami melanjutkan sesi ke-2. Masih dengan cara yang sama dengan menjawab bergantian seperti sesi pertama. Pertanyaan-pertanyaan di sesi ke-2 ini lebih menguras emosi dibandingkan dengan pertanyaan-pertanyaan di sesi pertama. Pertanyaan-pertanyaan di sesi ke-2 ini adalah jenis-jenis pertanyaan yang mungkin jarang ditanyakan secara langsung ke orang. Namun, jawaban-jawaban dari pertanyaan di sesi kedua ini biasanya sudah kita ketahui dari curhat-curhatan yang dilakukan pasangan kita sendiri.

Saking asyiknya kita berdua melakukan eksperimen ini sudah tidak terasa waktu sudah larut malam (sekali). Dan kita hanya mampu menyelesaikan sampai sesi ke-2 saja. Mengingat kereta saya berangkat pukul 3 pagi sehingga Saya terpaksa harus pulang untuk bersiap-siap.

Kesimpulan.
Duh berasa kayak laporan praktikum aja.

Kesan yang dijumpai setealh melakukan eksperimen ini adalah kita memang merasa lebih intim terhadap pasangan. Sek, kenapa intim konotasinya negatif yah..?
Oke saya ganti dengan dengan dekat.

Kesan yang dijumpai selelah melakukan eksperimen ini adalah kita merasa lebih dekat terhadap pasangan. Walaupun saya sudah mengenal pacar saya selama 10 tahun dan kita baru pacaran beberapa tahun belakang. Saya merasa bahwa masih ada hal yang belum saya ketahui tentangnya, mimpinya, cita-citanya,
masih banyak hal baru yang menarik yang belum terungkap di sosoknya,
masih ada saja hal yang menarik darinya yang belum saya kagumi.

Di sesi pertama saja saya sudah dibuat kagum oleh salah satu jawabanya mengenai mimpinya. Saya sudah tau tentang salah satu mimpinya tersebut. Namun lewat eksperimen yang kita lakukan ini dia menceritakan mimpinya secara detail, dia menceritakan dengan begitu antusias. Terlihat dari matanya, cara dia menceritakan tanpa henti, nada suaranya yang lembut. Cantik.

Yang membuat lama dari eksperimen ini adalah dari setiap pertanyaan yang telah disediakan, kemudian diteruskan dengan pertanyaan-pertanyaan selanjutnya yang mengalir begitu saja. Entah itu cerita di masa lalu, pengalaman yang sudah kita alami, mengulang cerita yang sudah pernah kita ceritakan namun tidak pernah ada bosannya untuk diceritakan kembali ataupun mendengar kembali. It’s like we were on a time capsule that goes to the past and the future for every question related.
Menceritakan pengalaman, rasa, suka, cita, dan mimpi.

Sesi ke-3 akan kami lakukan sebulan lagi, saat jadwal rutin pulang (baca:pacaran) datang,hhe. Maklum kaum LDR. Berikut daftar pertanyaan yang terdapat dalam eksperimen tersebut.
Pantas saja ada sepasang stranger yang bisa jatuh cinta melalui eksperimen ini. So, falling in love is scientifically proven.
Sampai-sampai saya kepikiran untuk membuka bisnis untuk mengumpulkan para single-single kemudian memfasilitasi untuk melakukan blind date ato speed dating gitu kayak di tipi tipi dengan menyisipkan pertanyaan-pertanyaan di eksperimen ini. Jadi kalo ada investor yang berminat silahkan menghubungi .. loh??jayus.

Anyway.Silahkan mencoba.

Berikut daftar pertanyaan yang terdapat dalam eksperimen tersebut,

The 36 Questions That Lead to Love

Set I

1. Given the choice of anyone in the world, whom would you want as a dinner guest?

2. Would you like to be famous? In what way?

3. Before making a telephone call, do you ever rehearse what you are going to say? Why?

4. What would constitute a “perfect” day for you?

5. When did you last sing to yourself? To someone else?

6. If you were able to live to the age of 90 and retain either the mind or body of a 30-year-old for the last 60 years of your life, which would you want?

7. Do you have a secret hunch about how you will die?

8. Name three things you and your partner appear to have in common.

9. For what in your life do you feel most grateful?

10. If you could change anything about the way you were raised, what would it be?

11. Take four minutes and tell your partner your life story in as much detail as possible.

12. If you could wake up tomorrow having gained any one quality or ability, what would it be?

Set II

13. If a crystal ball could tell you the truth about yourself, your life, the future or anything else, what would you want to know?

14. Is there something that you’ve dreamed of doing for a long time? Why haven’t you done it?

15. What is the greatest accomplishment of your life?

16. What do you value most in a friendship?

17. What is your most treasured memory?

18. What is your most terrible memory?

19. If you knew that in one year you would die suddenly, would you change anything about the way you are now living? Why?

20. What does friendship mean to you?

21. What roles do love and affection play in your life?

22. Alternate sharing something you consider a positive characteristic of your partner. Share a total of five items.

23. How close and warm is your family? Do you feel your childhood was happier than most other people’s?

24. How do you feel about your relationship with your mother?

Set III

25. Make three true “we” statements each. For instance, “We are both in this room feeling … “

Continue reading the main storyContinue reading the main story
26. Complete this sentence: “I wish I had someone with whom I could share … “

27. If you were going to become a close friend with your partner, please share what would be important for him or her to know.

28. Tell your partner what you like about them; be very honest this time, saying things that you might not say to someone you’ve just met.

29. Share with your partner an embarrassing moment in your life.

30. When did you last cry in front of another person? By yourself?

31. Tell your partner something that you like about them already.

32. What, if anything, is too serious to be joked about?

33. If you were to die this evening with no opportunity to communicate with anyone, what would you most regret not having told someone? Why haven’t you told them yet?

34. Your house, containing everything you own, catches fire. After saving your loved ones and pets, you have time to safely make a final dash to save any one item. What would it be? Why?

35. Of all the people in your family, whose death would you find most disturbing? Why?

36. Share a personal problem and ask your partner’s advice on how he or she might handle it. Also, ask your partner to reflect back to you how you seem to be feeling about the problem you have chosen.

Continue reading

© 2018 Rijdz

Theme by Anders NorenUp ↑