SAP ABAP SAPScript Interview Questions

How do I create Boxes in SAPScript?

You can create Boxes in the SAPScript using the BOX command specifying the x,y co-ordinates and the width and the height
BOX XPOS '0' CM YPOS '0.5' CM WIDTH '9.2' CM HEIGHT '3.5' CM FRAME 8 TW

How do I set tabs between the fields in display?

In the Paragraph Format tab, create a new paragraph format. In the "Tabs" Tab, enter the tab position and the alignment for the fields.

How do I create standard texts for the scripts?

You can create standard texts using the transaction SO10. Then to insert these standard texts in the SAPScript choose the menu, Insert->Text->Standard and choose the standard text that you want to choose.
Alternatively, you can display standard texts in your SAP Scripts using the command:
INCLUDE ZSTEXT OBJECT TEXT ID ST LANGUAGE EN
  • where ZSTEXT refers to the Standard Text name.

How can I debug my SAPScript?

Go to the transaction SE71.
Enter the form name.
Choose the menu Utilities->Activate Debugger to enable debugging.

I have created a script in language DE. Now I need to translate it to EN. How could I do this?

Open your script in transaction SE71.
In the Header screen, in the Language Attributes Option, choose Translate to... Option to translate to other languages.

How can I Word Wrap the text being displayed in SAPScript?

Use the Function Module RKD_WORD_WRAP to wrap the text and use this for output.

How can I display barcodes in SAPScripts?

Create a character format in the SAPScript.
Choose the Bar Code for the character format.

And finally to display barcodes, in the command enter:
&vbeln&
  • where C1 is the character format created and vbeln is the variable for which the barcode is to be created.

How can I print logos in SAPScripts?

  1. Convert the logo to a TIFF(*.tif) file.
    • Use the program RSTXLDMC to convert the TIFF file to standard text.
    • Print this using the INCLUDE command:
    • INCLUDE ZLOGO OBJECT TEXT ID ST
  2. For bitmaps (*.bmp)
    • Go to transaction SE78
    • Choose BMAP under GRAPHICS
    • Choose Import Graphic (F5)
    • Select the image and upload
    • In SE71 choose Insert->Graphics and then choose the image for display

How can I copy SAPScripts from one client to another?

In the transaction SE71, enter the Form name and choose the menu, Utilities->Copy from client to copy SAPScripts from one client to another.
Use RSTXSCRP to import/export SAPScripts.

How can I trigger new page in SAPScripts?

Use the command NEW-PAGE to trigger a new page in SAPScript.

How can I prevent page-break in the message that is to be displayed?

Enclose the text that you want to prevent page-break in PROTECT... ENDPROTECT
SAPscript will ensure that each line of this text is printed together on the same page.

/: PROTECT
*  Text
*  Within
*  The same page
/: ENDPROTECT

How can I set the position of the leading sign to left/right?

You can use the SET SIGN command to output the leading sign at the left or right.
/: SET SIGN LEFT
 
/: SET SIGN RIGHT

What are the various text formatting options in SAPScript?

&symbol(Z)&
Omit Leading Zeros
&symbol(S)&
Omit Leading Sign
&symbol(<)&
Display Leading Sign to the Left
&symbol(>)&
Display Leading Sign to the Right
&symbol(C)&
Compress Spaces
&symbol(.N)&
Display upto N decimal places
&symbol(T)&
Omit thousands separator
&symbol(R)&
Right justified

Frequently Used System Variables in SAPScript?

&DATE&
Currentdate
&DAY&
Day
&MONTH&
Month
&YEAR&
Year
&TIME&
Time of the day
&HOURS&
Hours
&MINUTES&
Minutes
&SECONDS&
Seconds
&PAGE&
Page
&NEXTPAGE&
Next page number
&SPACE&
Blank
&ULINE&
Underline
&VLINE&
Vertical line
&NAME_OF_MONTH&
Name of the Month
Smartforms

    How can I insert symbols in Smartforms?

    Select the Text node.
    Change Editor (Click the button above Check near the Editor)
    Go to menu Include->Characters->SAP Symbols
    Choose the SAP symbol that you want to insert.

    I have a smartform which works fine in DEV. After trasnsporting it to PROD, there is no Function module generated for this smartform. As a result my program dumps in PROD?

    The Smartform that is created in the Development may not have the same name in the Production server. So it is always advised to use the Function Module SSF_FUNCTION_MODULE_NAME to get the Function Module name by passing the Smartform name.
    DATA: fm_name TYPE rs38l_fnam.
     
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname           = 'ZSMARTFORM'
      IMPORTING
        fm_name            = fm_name
      EXCEPTIONS
        no_form            = 1
        no_function_module = 2
        OTHERS             = 3.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
     
    CALL FUNCTION fm_name
     EXCEPTIONS
        formatting_error = 1
        internal_error   = 2
        send_error       = 3
        user_canceled    = 4
        OTHERS           = 5.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

    How can I make the Smartforms to choose a printer name by default?

    In the CALL FUNCTION of the Smartform Function Module, set the output options parameter to set the printer name.
    The output options is of the type SSFCOMPOP which contains the field TDDEST. Set the TDDEST field to your default printer name.

    How can I make the Smartforms to display a print preview by default without displaying the popup for print parameters?

    In the SSF_OPEN function module,
    Set the OUTPUT OPTIONS paramter TDDEST to your printer name.
    Set the CONTROL PARAMETERS and control parameters as shown below,

    control-preview = 'X'.
    control-no_open = 'X'.
    control-no_close = 'X'.
    control-no_dialog = 'X'.
    control-device = 'PRINTER'.
    control_parameters-no_dialog = 'X'.
    control_parameters-no_open = 'X'.
    control_parameters-no_close = 'X'.
    OUTPUT_OPTIONS-TDDEST = 'PRINTER NAME'.
    OUTPUT_OPTIONS-TDNOPRINT = 'X'.
     
    CALL FUNCTION 'SSF_OPEN'
      EXPORTING
        output_options     = output_options
        control_parameters = control
        user_settings      = ' '
      EXCEPTIONS
        formatting_error   = 1
        internal_error     = 2
        send_error         = 3
        user_canceled      = 4
        OTHERS             = 5.
     
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Screen Painter
    To use ALV in dynpro, create only a container in the dynpro.
    In ABAP code (PBO/PAI), you have to use SALV class to create the list in the container of dynpro.
    It is much more effective than to use the type Pool SLIS and function REUSE_ALV_GRID_DISPLAY
    For example, you can then properly connect the screens with levels of different details or make fields of the list seizable by the users.

    What is a BADI?

    BADI stands for Business Add-In. These are like user exits but are implemented using ABAP Objects. More information can be found
    Related Posts

    No comments:

     

    Aired | Copyright © 2009-2014; All Rights Reserved 2014 | Contact Us | About Us