how to create a Table data type and modifying it!
6:26 PM
PS this is a self note!
I use to creat a working area to store the data temp and then only modify the Internal structure which is quite a hassle.
Short cut!
* Declare the type of Internal structure!
TYPES: BEGIN OF ty_report,
SKIP(1) TYPE C,
SEQNO TYPE I,
butxt TYPE t001-BUtxt, " Company name
pernr TYPE p0761-pernr, " PF No.
END OF ty_report.
* Declare the Internal table Please take note of the declaration which will help us modify the table direct
DATA: t_report TYPE STANDARD TABLE OF TY_report WITH HEADER LINE INITIAL SIZE 0.
* the coding below is when you want to change it
LOOP AT t_report WHERE SKIP NE 'X'.
t_report-butxt = 'TESTING'.
MODIFY t_report.
ENDLOOP.
-------------
simple eh phew...
I use to creat a working area to store the data temp and then only modify the Internal structure which is quite a hassle.
Short cut!
* Declare the type of Internal structure!
TYPES: BEGIN OF ty_report,
SKIP(1) TYPE C,
SEQNO TYPE I,
butxt TYPE t001-BUtxt, " Company name
pernr TYPE p0761-pernr, " PF No.
END OF ty_report.
* Declare the Internal table Please take note of the declaration which will help us modify the table direct
DATA: t_report TYPE STANDARD TABLE OF TY_report WITH HEADER LINE INITIAL SIZE 0.
* the coding below is when you want to change it
LOOP AT t_report WHERE SKIP NE 'X'.
t_report-butxt = 'TESTING'.
MODIFY t_report.
ENDLOOP.
-------------
simple eh phew...
Messaging across SAP client using function module th_popup and ,how to calling transaction code from a program
11:41 PM
Ever wanted to send message across use this function! huhu
th_popup
with a little bit of programming you can make a program to call the function Example
*&---------------------------------------------------------------------*
*& program to call function and to message sy-uid *
*& Function module th_popup is being called *
*&---------------------------------------------------------------------*
REPORT Y_MARK_CALLFUNCTION.
* include section -----------------------------------------------------
* declaration part ----------------------------------------------------
TABLES: SSCRFIELDS,UINFO.
DATA : CLIENT type sy-MANDT.
SELECTION-SCREEN BEGIN OF BLOCK BLK01 WITH FRAME TITLE TEXT-T01.
SELECTION-SCREEN SKIP.
PARAMETERS: "CLIENT LIKE SY-MANDT OBLIGATORY,
USER LIKE SY-UNAME OBLIGATORY,
MESSAGE LIKE SM04DIC-POPUPMSG OBLIGATORY.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK BLK01.
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON (20) EXECUT USER-COMMAND EXECUT MODIF ID A.
SELECTION-SCREEN END OF LINE.
INITIALIZATION.
CLIENT = SY-MANDT."SY-SYSID.
AT SELECTION-SCREEN OUTPUT.
MOVE 'Send by' TO EXECUT.
AT SELECTION-SCREEN.
IF SSCRFIELDS-UCOMM EQ 'EXECUT' OR SSCRFIELDS-UCOMM is initial.
SSCRFIELDS-UCOMM = 'ONLI'.
ENDIF.
* main program -------------------------------------------------------
START-OF-SELECTION.
concatenate MESSAGE 'from' SY-UNAME into MESSAGE separated by space.
CALL FUNCTION 'TH_POPUP'
EXPORTING
CLIENT = CLIENT
USER = USER
MESSAGE = MESSAGE.
IF SY-SUBRC <> 0.
ENDIF.
RETURN.
END-OF-SELECTION.
th_popup
with a little bit of programming you can make a program to call the function Example
*&---------------------------------------------------------------------*
*& program to call function and to message sy-uid *
*& Function module th_popup is being called *
*&---------------------------------------------------------------------*
REPORT Y_MARK_CALLFUNCTION.
* include section -----------------------------------------------------
* declaration part ----------------------------------------------------
TABLES: SSCRFIELDS,UINFO.
DATA : CLIENT type sy-MANDT.
SELECTION-SCREEN BEGIN OF BLOCK BLK01 WITH FRAME TITLE TEXT-T01.
SELECTION-SCREEN SKIP.
PARAMETERS: "CLIENT LIKE SY-MANDT OBLIGATORY,
USER LIKE SY-UNAME OBLIGATORY,
MESSAGE LIKE SM04DIC-POPUPMSG OBLIGATORY.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK BLK01.
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON (20) EXECUT USER-COMMAND EXECUT MODIF ID A.
SELECTION-SCREEN END OF LINE.
INITIALIZATION.
CLIENT = SY-MANDT."SY-SYSID.
AT SELECTION-SCREEN OUTPUT.
MOVE 'Send by' TO EXECUT.
AT SELECTION-SCREEN.
IF SSCRFIELDS-UCOMM EQ 'EXECUT' OR SSCRFIELDS-UCOMM is initial.
SSCRFIELDS-UCOMM = 'ONLI'.
ENDIF.
* main program -------------------------------------------------------
START-OF-SELECTION.
concatenate MESSAGE 'from' SY-UNAME into MESSAGE separated by space.
CALL FUNCTION 'TH_POPUP'
EXPORTING
CLIENT = CLIENT
USER = USER
MESSAGE = MESSAGE.
IF SY-SUBRC <> 0.
ENDIF.
RETURN.
END-OF-SELECTION.
How to debug a dialog screen
11:36 PM
Ever came to a screen where you cant manually enter the transactioncode "/h" ?
Now you can use the tips below.
1. Save the below command in a text file and paste the below coding
[FUNCTION]
Command=/H
Title=Debugger
Type=SystemCommand
2. Drag and drop onto the screen and walla! Debug mode on!
------------------------
tips you can play with the Command and put your own customized / standard transaction code! :D
Thanks to my colleague Ghaffar!
Now you can use the tips below.
1. Save the below command in a text file and paste the below coding
[FUNCTION]
Command=/H
Title=Debugger
Type=SystemCommand
2. Drag and drop onto the screen and walla! Debug mode on!
------------------------
tips you can play with the Command and put your own customized / standard transaction code! :D
Thanks to my colleague Ghaffar!
SELF NOTE : appending and creating table and structure
1:39 AM
Some might not understand what is this but it is just for my notes : D
DATA : IT_DETAIL TYPE TABLE OF BAPIP0006LMY,
S_DETAIL LIKE LINE OF IT_DETAIL.
DATA : IT_DETAIL_FULL TYPE TABLE OF BAPIP0006LMY WITH HEADER LINE.
LOOP AT IT_DETAIL into S_DETAIL.
MOVE-CORRESPONDING S_DETAIL to IT_DETAIL_FULL.
APPEND IT_DETAIL_FULL.
ENDLOOP.
Another tips from Gaafar : D
DATA : IT_DETAIL TYPE TABLE OF BAPIP0006LMY,
S_DETAIL LIKE LINE OF IT_DETAIL.
DATA : IT_DETAIL_FULL TYPE TABLE OF BAPIP0006LMY WITH HEADER LINE.
LOOP AT IT_DETAIL into S_DETAIL.
MOVE-CORRESPONDING S_DETAIL to IT_DETAIL_FULL.
APPEND IT_DETAIL_FULL.
ENDLOOP.
Another tips from Gaafar : D
SAP GUI. Break Point!
1:35 AM
Just got to know that we can create a break point using our sy-uname.
just add this
break xxxxx.
" where by xxxxx. is your sy-uname also known as login name for back end sap
contributed by Gaafar ygl! :D
just add this
break xxxxx.
" where by xxxxx. is your sy-uname also known as login name for back end sap
contributed by Gaafar ygl! :D
adding tcode into sap menu (not favourite)
9:43 PM
12:40:12 PM: Koh Lee Yoong: fyi..regarding d sap menu...
12:40:28 PM: Koh Lee Yoong: whereby to add transaction..
12:40:37 PM: Koh Lee Yoong: u can use se43...n area menu should be s000
12:40:28 PM: Koh Lee Yoong: whereby to add transaction..
12:40:37 PM: Koh Lee Yoong: u can use se43...n area menu should be s000