Search This Blog

Tuesday, April 17, 2012

Question Marks '?????' in Menu Bar instead of Menu Names


If the menu bar displayed in your custom report or in any other sap screen is like the image above, try deleting the language specific run time objects (Load).

To delete language specific run time objects execute the report RSLANG20.This resets the language buffers and reloads them from the database.

To access certain information more quickly, the SAP System optimizes the information in database tables and internal buffers.
This information must be deleted after a language import or supplementation.The language transport tools delete the language load automatically after completing an import or supplementation action. However, database locks may prevent the load from being deleted. This report enables you to delete the load manually in this case.
This report does not cause errors in the system and can be restarted at any time. However, you may experience a short drop in performance after starting the report.

Use the check boxes to select which load types you want to delete.
To delete a language-specific load, you must enter a target language. You also have the option of deleting the load for all languages installed in the system.

For more information, you can check the source code of the program or see SAP Note 110910.

Thursday, March 29, 2012

Change Description of Transport Request

Description of an unreleased transport request can be changed in the following steps :
  • Go to transaction SE10
  • Select the request whose description needs to be changed and click on display or just double click on the tr number.
  • Now on the new screen click on change (Ctrl + F1).
  • Click on Properties Tab on the same screen.
  • The description of the tr can be seen in editable mode.
  • Change it as desired and click on Save button (Ctrl + S).



Please comment on the post if you find it useful, it will only take 2 seconds and will cost you nothing.

Tuesday, December 13, 2011

Simple steps to get Smartform output into PDF Format

Do the following:

  1. Print the smartform to the spool. 
  2. Note the spool number.
  3. Go to T-Code SE38 and execute the standard program  RSTXPDFT4 and download the PDF file by entering the spool number in the selection screen.

Friday, August 12, 2011

Sample Code to Lock / Unlock Program Editor


Program to Lock / Unlock program editor. The SAP Standard Table TRDIR has a field called EDTX which is basically the EDITOR lock field. Edit Lock facility is given in the PROGRAM ATTRIBUTES. The EDITOR LOCK is a check box given in the PROGRAM ATTRIBUTES. If this field is SET then the program gets locked and if this is Unchecked the program is unlocked.


If the EDITOR lock is ON then only the user who created the program can edit it.
REPORT  ZXXXX.
TABLES : TRDIR.

PARAMETERS : PROG_NAM LIKE TRDIR-NAME,
             EDTX 
LIKE TRDIR-EDTX.

SELECT SINGLE * FROM TRDIR WHERE NAME = PROG_NAM.

  
IF SY-SUBRC = 0.
    
IF TRDIR-EDTX = EDTX AND EDTX = ' '.
      
MESSAGE 'Already Unlocked' TYPE 'I'.
    
ELSEIF TRDIR-EDTX = EDTX AND EDTX = 'X'.
      
MESSAGE 'Already Locked' TYPE 'I'.
    
ELSE.
    TRDIR-EDTX = EDTX.
    
MODIFY TRDIR.
        
IF EDTX = ' '.
          
MESSAGE 'Program Successfully Unlocked' TYPE 'I'.
        
ELSE.
          
MESSAGE 'Program Successfully Locked' TYPE 'I'.
        
ENDIF.

    
ENDIF.
  
ELSE.
    
MESSAGE 'Program Not Found' TYPE 'I'.
  
ENDIF.



Upload Excel File Data using BDC

Sample Program to Upload MS Excel File data into SAP R/3 Using BDC
report ZXXXX
       
no standard page heading line-size 255.

include bdcrecx1.
TABLES : ZEMP.
DATA : ITAB TYPE STANDARD TABLE OF ZEMP WITH HEADER LINE,
G_XLDATA 
LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
DATA: p_file LIKE ibipparms-path.
start-
of-selection.

*Function Module to fetch file from the presentation server
  
CALL FUNCTION 'F4_FILENAME'
    
EXPORTING
      program_name  = syst-cprog
      dynpro_number = syst-dynnr
      field_name    = 
'P_FILE'
    
IMPORTING
      file_name     = p_file.

*Function Module to upload excel file data to internal table
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
  
EXPORTING
    FILENAME                      = p_file
    I_BEGIN_COL                   = 
1
    I_BEGIN_ROW                   = 
1
    I_END_COL                     = 
100
    I_END_ROW                     = 
100
  
TABLES
    INTERN                        = G_XLDATA
          .
LOOP AT G_XLDATA.
  
CASE G_XLDATA-COL.
    
WHEN 1.
      ITAB-EMPID = G_XLDATA-
VALUE.
    
WHEN 2.
      ITAB-EMPNAME = G_XLDATA-
VALUE.
    
WHEN 3.
      ITAB-STREET = G_XLDATA-
VALUE.
    
WHEN 4.
      ITAB-CITY = G_XLDATA-
VALUE.
      
APPEND ITAB.
      
CLEAR ITAB.
  
ENDCASE.
 
ENDLOOP.


perform open_group.

LOOP AT ITAB.

perform bdc_dynpro      using 'ZRSCREEN1' '0100'.
perform bdc_field       using 'BDC_OKCODE'
                              
'=INSERT'.
perform bdc_field       using 'BDC_CURSOR'
                              
'ZEMP-CITY'.
perform bdc_field       using 'ZEMP-EMPID'
                              ITAB-EMPID.
perform bdc_field       using 'ZEMP-EMPNAME'
                              ITAB-EMPNAME.
perform bdc_field       using 'ZEMP-STREET'
                              ITAB-STREET.
perform bdc_field       using 'ZEMP-CITY'
                              ITAB-CITY.
perform bdc_dynpro      using 'ZRSCREEN1' '0100'.
perform bdc_field       using 'BDC_OKCODE'
                              
'/ELOGOUT'.
perform bdc_field       using 'BDC_CURSOR'
                              
'ZEMP-EMPID'.
perform bdc_field       using 'ZEMP-EMPID'
                              
'11'.
perform bdc_field       using 'ZEMP-EMPNAME'
                              
'JAMES SAWYER'.
perform bdc_field       using 'ZEMP-STREET'
                              
'B-100'.
perform bdc_field       using 'ZEMP-CITY'
                              
'SECTOR-100'.
perform bdc_transaction using 'ZRSCREEN1'.

ENDLOOP.
perform close_group.

Saturday, July 30, 2011

Download Smartform Output in PDF Format

SAP Smart Forms are used to create and maintain forms for mass printing in SAP Systems. As an output
medium SAP Smart Forms support a printer, a fax, e-mail. Many a times there is requirement to download
output of SAP Smart Forms in a PDF file.
Adobe® Portable Document Format (PDF) is a universal file format that contains all fonts, formats, and graphics. PDF files are widely used in the Internet, not least because the content of a PDF file cannot be changed, in contrast to Word.
Smart Forms does not support direct output in PDF format. Instead, the OTF output has to be converted to PDF. Fonts and code pages used have to be correct in the OTF output and are dependent on the language in which the form is printed. Depending on the language, a different device type that supports the corresponding fonts has to be used for printing.
A device type for printing PDF or for creating a PDF file is therefore not adequate for a Smart Form that is used as a template for printing forms in a number of languages. The device type has to be set dynamically before the Smart Forms function module is called.

Converting the smartform to PDF is process of 3 simple steps.
  • Calling the Smart form, then it returns the OTF data in Return.
  • Converting the OTF data into required format using the Function Module CONVERT_OTF_2_PDF.
  • Download the File

1. Call function module SSF_FUNCTION_MODULE_NAME. It returns the name of the generated function module. Call the generated function module.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    FORMNAME                 = 'SMARTFORM-NAME'
  IMPORTING
   
FM_NAME                  = FMNAME .

2. To get a device type suitable for the current language, call the function module SSF_GET_DEVICE_TYPE.

CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
  EXPORTING
    I_LANGUAGE                   = 'E'
  IMPORTING
   E_DEVTYPE                    = v_e_devtype  .




3. Call Smartform

CALL
 FUNCTION FMNAME
 EXPORTING
   CONTROL_PARAMETERS         = st_control_parameters
   OUTPUT_OPTIONS             = st_output_options
  IMPORTING
   DOCUMENT_OUTPUT_INFO       = st_document_output_info
   JOB_OUTPUT_INFO            = st_job_output_info
   JOB_OUTPUT_OPTIONS         = st_job_output_options
  TABLES
    ITAB                       = ITAB
    ITAB1                      = ITAB1     .


4. Call the function module 'CONVERT_OTF_2_PDF' to convert the smart form to PDF format. The function module returns the size of downloaded file.

CALL FUNCTION 'CONVERT_OTF_2_PDF'
  IMPORTING
   BIN_FILESIZE                 = v_bin_filesize
  TABLES
    OTF                          = st_job_output_info-otfdata
    DOCTAB_ARCHIVE               = it_docs
    LINES                        = it_lines    .


5. You can then store the PDF output using the function module GUI_DOWNLOAD, for example, as a local file on your PC.

CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
   BIN_FILESIZE                    = v_bin_filesize
   FILENAME                       = 'SMART'
   FILETYPE                        = 'BIN'
  TABLES
    DATA_TAB                        = it_lines
          .





Tuesday, July 26, 2011

SAP Client Copy By Using SCC8 and SCC7

Client Copy can be done either using the remote client copy method or export/import method.

To do Remote client copy you need to use tcode  scc9
For Client export & Import  we use scc8 and scc7
For Export / Import:
   
Client Export:
1.  Run SCC8
2.  Select Profile for desired copy type (Usually All [SAP_ALL] or user master only [SAP_USER].  You will need direction from the requester as to the correct selection here.  Use Profile -> Display Profile to display profile details.)
3.  Select target System (or group)
4.  De- Select "Test Run" (If selected)
5.  Run Export
-  Up to 3 requests are created, depending on the data selected and available:
   1. "SIDKO00353" for transporting client-independent data, if you have selected this 
   2. "SIDKT00353" for transporting client-specific data 
   3. "SIDKX00353" for transporting client-specific texts, provided texts are available in this client            
6.Monitor TP logs for errors and export files for growth                            
   
Client Import:
1. Create client (scc4)
2. Login to client (sap* - pass)
3. Manually add "O" transport then "X" then "T" to TMS buffer
4. Highlight #1 and use "Request -> Import" to launch import tool
5. Monitor "I" file in OS "/usr/sap/trans/tmp" dir for progress info
6. After Import is complete perform "post processing steps" from client tool (SCC7)
   
For Local or Remote Copy:
   
Client Import:
1. Create client (scc4)
2. Login to new client (sap* - pass)
3. Run SCCL (Local copy ) or SCC9 (remote copy) and complete the form as required
    -  Select Profile for desired copy type (Usually All [SAP_ALL] or user master only [SAP_USER].  You will need direction from the requester as to the correct selection here.  Use Profile -> Display Profile to display profile details.)
    -  Select RFC Destination to copy from for Remote copy, or Source client to copy from for Local copies
    -  Execute in background
4.       Monitor SCC3 for copy status
5.       After Import is complete perform "post processing steps" from menu in client tool (SCC7)
  
Post Client Create Checks:
-  Adjust client settings as Dev / Config / or Closed as directed by requester.
-  Update Logon Screen for new / updated client info