Friday, September 23, 2016

Class to Create Webdynpro URL


This is the class to construct Webdynpro URL based on the Application Name

  " Obtain the URL  cl_wd_utilities=>construct_wd_url( exporting application_name = 'ZHR_EXAMPLE'                                                            in_parameters    = lt_parameter
                                                            importing out_local_url    = url ).

Thursday, September 22, 2016

Function to get PERNR based on user name




We can use below BADI to get person id or personal number  based on sy-uname


BAPI_USR01DOHR_GETEMPLOYEE



Tuesday, June 7, 2016


Debug Workflow Method





1.  Add below code to enable infinite loop

* Temporary, for debugging.
  DATA: lv_tmp(1).
  lv_tmp = 'X'.
  WHILE lv_tmp EQ 'X'.
  ENDWHILE.


2. Run the program.

3. GO to T-CODE SM50 amd check your program name  and user WF-BATCH.



4. Select Administration --Program--Debugging to start the debug process 

Friday, January 29, 2016

Editing Standard Program or Class but error ? you cannot perform this action in modification/enhancement mode



  1. Try to edit standard class/program that you had created but got below error 

    you cannot perform this action in modification/enhancement mode

  2. But how to fix it even access key already created to edit the program or class?
  3. You need to turn off the modification assistants 
  4. Edit - Modification Operations - Switch Off Assistants 


Tuesday, December 8, 2015

Getting xstring value from Source / URL



Code snippet to get Xstring value from source file either URL or Path File


DATA lr_mime_repository TYPE REF TO if_mr_api.
  
"
  
" Variables
  
DATA lv_img_xstring TYPE xstring.

  
SELECT SINGLE zparam_val1 FROM zett_value
  
INTO gv_img_source
  
WHERE zformtyp = 'ED03'
    
AND zparam_id1 = 'PATH'
    
AND zparam_id2 = 'NOPHOTO'.


  
TRY.
      
"MIME repository reference
      lr_mime_repository 
= cl_mime_repository_api=>get_api( ).

      
"Get file from MIME
      
CALL METHOD lr_mime_repository->get
        
EXPORTING
          i_url             
= gv_img_source
          i_check_authority 
= ' '
        
IMPORTING
          e_content         
= lv_img_xstring.

    
CATCH cx_root.
  
ENDTRY.

  
"Return binary representation of file
  gv_image_default 
= lv_img_xstring.

Thursday, July 30, 2015

SAPSCRIPT BOX




Simple Box

/: BOX FRAME 10 TW

You can use the POSITION and SIZE commands to set default parameters for a box.

You can write:

/: POSITION XORIGIN '11.21' YORIGIN '5.31' MM 
/: SIZE HEIGHT '2' MM WIDTH '76' MM 
/: BOX FRAME 10 TW INTENSITY 10


This can be useful if you gave several boxes that share the same parameters.

If you want to set the position relatively to the window use POSITION WINDOW
to set the position to the top/left start of the window. Then use POSITION
to set the current position relatively to the start of the Window.

Note that you uses "+" or "-" in the ORIGIN position to the set the position relatively.

/: POSITION WINDOW 
/: POSITION XORIGIN '+5' MM YORIGIN '+10' MM


the position is now 5 MM from the left and 10 MM from the top of the window

Drawing a line. You can draw a line by setting the Height or Widths to 0
and add a frame. E.g. a horizontal line:

/: SIZE HEIGHT '0' MM WIDTH '200' MM

https://pijush.wordpress.com/2007/05/08/to-print-the-total-in-a-sapscript/