Wednesday, September 26, 2012

MM Class characteristics

About TEXT_ID
----------------------------
Text ID details stored in table: TTXID
TTXID: Definition of Text IDs  
This control table contains all text IDs supported by SAPscript. Text IDs are always allocated to a text object.
The key of this table thus consists of the text object and a four-digit text ID. You can use the SAPscript
function modules only to process texts whose IDs are stored in this table. The table is client-independent.
To maintain the table, call transaction SE75 by choosing Tools > Word processing > Settings.
Text actual storage location is:
STXH - header
STXL - details.
if you want to read the texts you can use FM READ_TEXT
Any Application Header and tem Long texts are stored in STXH table with the 4 parameters OBJECT,ID,NAME and LANG
These texts are fetched from databse using READ_TEXT fun module by passing the above 4 parameters.
Double click on the text, from the text editor menu GOTO-> HEDAER
you will find the all above 4 paramters
so accordingly you have to pass to the fun module READ_TEXT to fetch the texts.
-----------------------------------------------------
CMOD to create a new enhancement

SMOD to test an old enhancement

MM classtype characteristic change specific enhancement CLFM0001/CLFM0002

CL03*: classtype characteristics maintenance

MM02: Material class modification

enhancement: ZXCLFU02 -status 'H' for modified New row, Status 'L' for old value.

If new value is blank, there will be no row with H, If previous characteristic value was blank then there will be no L row but H row.

T_ALLAUSP: characterisitc Table

T_ALLKSSK: classtype table.

If there is any change done by programmer in T_ALLAUSP must make E_ACTIVE flag true.

Logic to find class for a characteristic:

t_allausp-atinn = gt_cabn-atinn > gt_objectdata-atnam = gt_cabn-atnam > gt_class-class can be found at Index gt_objectdata-tabix.

Respective tables and there use:

AUSP contains all the characteristcs details for a material

CABN: contain list of characteristcs

CAWN: contains list of characteristics multiple value

KSSK: Allocation Table: Object to Class (Class assigned to a material)

Where to get object key for class

SELECT SINGLE cuobj FROM inob INTO gv_cuobj WHERE klart = 'Z01' AND obtab = c_mara AND objek = i_rmclf-objek.

objek = 18 digit material + 10 digit batch
 Put cuobj from above in AUSP to get material characteristic.


FM used:

FUNCTION 'POPUP_TO_CONFIRM'

gv_objkey = i_rmclf-objek. "'000000000000000855'.
EXPORT gv_objkey TO MEMORY ID c_memid.
IMPORT gv_objkey FROM MEMORY ID c_memid.
CALL FUNCTION 'BAPI_OBJCL_GETDETAIL'
EXPORTING
objectkey = gv_objkey
objecttable = c_mara
classnum = ls_rdetails-classname
classtype = ls_rdetails-classtype
keydate = sy-datum
language = sy-langu
TABLES
allocvaluesnum = gt_num_tab
allocvalueschar = gt_char_tab
allocvaluescurr = gt_curr_tab
return = gt_return.

CALL FUNCTION 'BAPI_OBJCL_CHANGE'
EXPORTING
objectkey = gv_objkey
objecttable = c_mara
"AUSP "'MCH1'
classnum = ls_rdetails-classname
classtype = ls_rdetails-classtype
TABLES
allocvaluesnumnew = gt_num_tab
allocvaluescharnew = gt_char_tab
allocvaluescurrnew = gt_curr_tab
return = gt_return.

* Collect class and classification detail for current class as well.

CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
EXPORTING
classtext = c_x
classtype = i_rmclf-klart
features = c_x
language = sy-langu
object = l_object
objecttable = c_mara
key_date = sy-datum
initial_charact = c_x
no_value_descript = c_x
change_service_clf = c_x
TABLES
t_class = gt_class
t_objectdata = gt_objectdata
EXCEPTIONS
no_classification =
1
no_classtypes =
2
invalid_class_type =
3
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF gt_objectdata IS NOT INITIAL.
SELECT atinn adzhl atnam atfor
FROM cabn
INTO TABLE gt_cabn
FOR ALL ENTRIES IN gt_objectdata1
WHERE atnam = gt_objectdata1-atnam.
ENDIF.
QM

QE03: Inspection Lot no display
QE51N: Inspection result display

Table linking: Flow of tables:
SELECT a~prueflos
         a~stat35
         a~charg
         a~werk
         a~matnr
         a~lifnr
         b~vdatum
               FROM qals AS a
               INNER JOIN qave AS b
               ON a~prueflos = b~prueflos
               INTO TABLE gt_qals
               WHERE a~matnr IN s_matnr
               AND   a~stat35 NE space
               AND   b~vdatum IN s_date.
  IF sy-subrc = 0.
    SELECT lifnr
           name1
           name2 INTO TABLE gt_lfa1
                 FROM lfa1
                 FOR ALL ENTRIES IN gt_qals
                 WHERE lifnr = gt_qals-lifnr.

  ELSE.
    MESSAGE text-004 TYPE c_s.
    LEAVE LIST-PROCESSING.
  ENDIF.

  LOOP AT gt_lfa1 INTO gs_lfa1.
    gs_lfa1-name2 = gs_lfa1-name2+0(3).
    APPEND gs_lfa1 TO lt_lfa1.
    CLEAR:gs_lfa1.
  ENDLOOP.
  DELETE lt_lfa1 WHERE name2 NOT IN s_region.
  CLEAR: gt_lfa1.
  gt_lfa1 = lt_lfa1.

  LOOP AT gt_lfa1 INTO gs_lfa1.
    ls_lifnr-sign   = c_i.
    ls_lifnr-option = c_eq.
    ls_lifnr-low = gs_lfa1-lifnr.
    APPEND ls_lifnr TO gt_lifnr.
    CLEAR: ls_lifnr, gs_lfa1.
  ENDLOOP.

  IF gt_lfa1 IS NOT INITIAL.
    DELETE gt_qals WHERE lifnr NOT IN gt_lifnr.
    IF gt_qals IS NOT INITIAL.

      SELECT prueflos
             merknr
             qpmk_werks
             verwmerkm
             mkversion FROM qamv
                       INTO TABLE gt_qamv
                       FOR ALL ENTRIES IN gt_qals
                       WHERE prueflos = gt_qals-prueflos.

      SELECT matnr
             maktx FROM makt
                   INTO TABLE gt_makt
                   FOR ALL ENTRIES IN gt_qals
                   WHERE matnr = gt_qals-matnr.

      SELECT qasr~prueflos
             qasr~vorglfnr
             qasr~merknr
             qasr~probenr
             qasr~pruefbemkt AS rpruefbemkt
             qasr~satzstatus
             qasr~anzwertg
             qase~pruefbemkt AS epruefbemkt
             qase~detailerg
             qase~code1
               INTO TABLE gt_qasr
               FROM qasr
               LEFT OUTER JOIN qase ON ( qase~prueflos = qasr~prueflos AND
                                         qase~merknr = qasr~merknr )
               FOR ALL entries IN gt_qals
               WHERE qasr~prueflos = gt_qals-prueflos AND
                     qasr~vorglfnr = c_001.

         SELECT phynr matnr charg plos2 entdatum
           FROM qprs
           INTO TABLE gt_qprs
           FOR ALL ENTRIES IN gt_qals
           WHERE plos2 = gt_qals-prueflos AND
                entdatum <> c_0.
    ENDIF.
  ELSE.
    MESSAGE text-004 TYPE c_s.
    LEAVE LIST-PROCESSING.
  ENDIF.






Thursday, May 10, 2012

Object Oriented ALV

Example:
*Global data for ALV display
DATA: splitter_1  TYPE REF TO cl_gui_splitter_container,
      container   TYPE REF TO cl_gui_custom_container,
      container_1 TYPE REF TO cl_gui_container,
      container_2 TYPE REF TO cl_gui_container,
      container_3 TYPE REF TO cl_gui_container,
      container_4 TYPE REF TO cl_gui_container,
      grid1       TYPE REF TO cl_gui_alv_grid,
      grid2       TYPE REF TO cl_gui_alv_grid,
      grid3       TYPE REF TO cl_gui_alv_grid,
      grid4       TYPE REF TO cl_gui_alv_grid,
      ok_code     TYPE sy-ucomm,
      loyo        TYPE lvc_s_layo.
*----------------------------------------------------------------------*
*           FOR FIELD CATALOG
*----------------------------------------------------------------------*
DATA: gt_fieldcatalogue TYPE lvc_t_fcat,
      gs_fieldcatalogue TYPE lvc_s_fcat.
DATA: g_container      TYPE scrfname.

*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
  SET PF-STATUS 'ZALV'.
  SET TITLEBAR 'ZTITLE'.
*creating object reference for container
  CREATE OBJECT container
    EXPORTING
      container_name = g_container."Pass name of container created in Screen no 9010
*splitting the main container into 3 rows
  CREATE OBJECT splitter_1
    EXPORTING
      parent  = container
      rows    = 4
      columns = 1.
*getting the reference for the splited container (row 1 & col 1 container)
  CALL METHOD splitter_1->get_container
    EXPORTING
      row       = 1
      column    = 1
    RECEIVING
      container = container_1.
*getting the reference for the splited container (row 2 & col 1 container)
  CALL METHOD splitter_1->get_container
    EXPORTING
      row       = 2
      column    = 1
    RECEIVING
      container = container_2.
*getting the reference for the splited container (row 3 & col 1 container)
  CALL METHOD splitter_1->get_container
    EXPORTING
      row       = 3
      column    = 1
    RECEIVING
      container = container_3.
*populating first internal table to the container
  CREATE OBJECT container
    EXPORTING
      container_name = g_container.
  CREATE OBJECT grid1
    EXPORTING
      i_parent = container_1.
* FOR LAYOUT
  loyo-zebra = c_x.
  loyo-cwidth_opt = c_x.
  loyo-grid_title = 'This is actually grid title'.
*  loyo-stylefname = c_sfn100.
  PERFORM create_fieldcatalog USING c_grid1.
  CALL METHOD grid1->set_table_for_first_display
    EXPORTING
      is_layout       = loyo
    CHANGING
      it_fieldcatalog = gt_fieldcatalogue
      it_outtab       = gt_table1.
*populating second internal table
  CREATE OBJECT container
    EXPORTING
      container_name = g_container.
  CREATE OBJECT grid2
    EXPORTING
      i_parent = container_2.
* FOR LAYOUT
  loyo-grid_title = text-020.
  PERFORM create_fieldcatalog USING c_grid2.
  CALL METHOD grid2->set_table_for_first_display
    EXPORTING
      is_layout       = loyo
    CHANGING
      it_fieldcatalog = gt_fieldcatalogue
      it_outtab       = gt_table2.
*populating third internal table
  CREATE OBJECT container
    EXPORTING
      container_name = g_container.
  CREATE OBJECT grid3
    EXPORTING
      i_parent = container_3.
* FOR LAYOUT
  loyo-grid_title = 'Title 3'.
  PERFORM create_fieldcatalog USING c_grid3.
  CALL METHOD grid3->set_table_for_first_display
  EXPORTING
     is_layout        = loyo
  CHANGING
    it_fieldcatalog = gt_fieldcatalogue
     it_outtab      = gt_table3.
ENDMODULE.                 " STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
  CALL METHOD cl_gui_cfw=>dispatch.
  CASE ok_code.
    WHEN 'BACK'.
      LEAVE TO SCREEN 0.
    WHEN 'CANCEL'.
      LEAVE TO SCREEN 0.
    WHEN 'EXIT'.
      LEAVE PROGRAM.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*& Module EXIT INPUT                                                        *
*&---------------------------------------------------------------------*
MODULE exit INPUT.
*free the container memory when exit
  CALL METHOD container->free.
  LEAVE PROGRAM.
ENDMODULE.  "EXIT INPUT


 

Useful Tips MM

UoM Conversion Logic Explained
*&---------------------------------------------------------------------*
*&      Form  CONVERSION_UOM
*&---------------------------------------------------------------------*
* IF BUoM is CS: CWM field will contains LB value and normal in CS
* IF BUoM is LB: CWM fields will contain CS value and normal in LB
*----------------------------------------------------------------------*
FORM conversion_uom.
  DATA:   ls_mara       TYPE ty_mara,
          ls_mchb       TYPE ty_mchb,
          ls_mchb_temp  TYPE ty_mchb,
          lt_mchb       TYPE TABLE OF ty_mchb,
          l_index       TYPE sy-tabix.
  LOOP AT gt_mara INTO ls_mara.
    l_index = sy-tabix.
    READ TABLE gt_mchb INTO ls_mchb WITH KEY matnr = ls_mara-matnr.
    IF ls_mara-/cwm/xcwmat = c_x AND ls_mara-meins = c_lb.
      ls_mchb-clabs = ls_mchb-/cwm/clabs.
      MODIFY gt_mchb INDEX l_index FROM ls_mchb TRANSPORTING clabs.
    ELSEIF ls_mara-meins NE c_cs AND ls_mara-meins NE c_lb.
      CALL METHOD zcl_pin_convert_new_uom=>convert_uom
        EXPORTING
          i_matnr              = ls_mara-matnr
          i_from_uom           = ls_mara-meins
          i_to_uom             = c_csmeins
          i_qty                = ls_mchb-clabs
        IMPORTING
          e_qty                = ls_mchb-clabs
        EXCEPTIONS
          meins_not_maintained = 1
          meinh_not_maintained = 2
          unexpected_error     = 3
          OTHERS               = 4.
      IF sy-subrc = 0.
        MODIFY gt_mchb INDEX l_index FROM ls_mchb TRANSPORTING clabs.
      ENDIF.
    ENDIF.
    CLEAR: l_index, ls_mara.
  ENDLOOP.
ENDFORM.                    " CONVERSION_UOM
******

METHOD convert_uom.

  DATA : lv_from TYPE meins,
         lv_to TYPE meins,
         l_value_meins_tmp TYPE f,
         lv_input1 TYPE cd0fltp,
         lv_output1 TYPE cd0fltp.

  IF i_from_uom = i_to_uom
    AND i_from_uom IS NOT INITIAL
    AND i_to_uom   IS NOT INITIAL
    AND i_from_uom IS SUPPLIED
    AND i_to_uom   IS SUPPLIED.
    CATCH SYSTEM-EXCEPTIONS arithmetic_errors = 4
                              OTHERS = 8.
      e_qty = i_qty.
    ENDCATCH.
    IF sy-subrc <> 0.
      RAISE unexpected_error.
    ENDIF.
  ELSE.

    IF i_qty IS SUPPLIED.
      CATCH SYSTEM-EXCEPTIONS arithmetic_errors = 4
                              OTHERS = 8.
        lv_input1 = i_qty.
      ENDCATCH.
      IF sy-subrc <> 0.
        RAISE unexpected_error.
      ENDIF.
    ELSE.
      lv_input1 = 1.
    ENDIF.

    IF i_to_uom IS NOT SUPPLIED.
      SELECT SINGLE meins FROM mara INTO lv_to WHERE matnr = i_matnr.
      IF sy-subrc <> 0.
        RAISE meinh_not_maintained.
      ENDIF.
    ELSE.
      lv_to = i_to_uom.
    ENDIF.

    IF i_from_uom IS NOT SUPPLIED.
      SELECT SINGLE meins FROM mara INTO lv_from WHERE matnr = i_matnr.
      IF sy-subrc <> 0.
        RAISE meins_not_maintained.
      ENDIF.
    ELSE.
      lv_from = i_from_uom.
    ENDIF.
    CLEAR lv_output1.

*   Umrechnung in Basismenge
    CALL FUNCTION 'MATERIAL_UNIT_CONVERSION'
      EXPORTING
        matnr                = i_matnr
        input                = lv_input1
        meinh                = lv_from
        kzmeinh              = 'X'
      IMPORTING
        output               = l_value_meins_tmp
      EXCEPTIONS
        conversion_not_found = 01
        input_invalid        = 02
        material_not_found   = 03
        meinh_not_found      = 04
        meins_missing        = 05
        no_meinh             = 06
        output_invalid       = 07
        overflow             = 08.
    IF sy-subrc <> 0.
      RAISE unexpected_error.
    ENDIF.
*   Umrechnung auf neue Alternativmengeneinheit
    CALL FUNCTION 'MATERIAL_UNIT_CONVERSION'
      EXPORTING
        matnr                = i_matnr
        input                = l_value_meins_tmp
        meinh                = lv_to
        kzmeinh              = space
      IMPORTING
        output               = lv_output1
      EXCEPTIONS
        conversion_not_found = 01
        input_invalid        = 02
        material_not_found   = 03
        meinh_not_found      = 04
        meins_missing        = 05
        no_meinh             = 06
        output_invalid       = 07
        overflow             = 08.

    IF sy-subrc <> 0.
      RAISE unexpected_error.
    ELSE.
      CATCH SYSTEM-EXCEPTIONS arithmetic_errors = 4
                              OTHERS = 8.
        e_qty = lv_output1.
      ENDCATCH.
      IF sy-subrc <> 0.
        RAISE unexpected_error.
      ENDIF.
    ENDIF.
  ENDIF.
ENDMETHOD.


**********
Code to Explode or find Material where used
FORM explode_material .
   DATA: gt_shadow    TYPE TABLE OF chvwshadow,
        gs_dfchvw       TYPE dfchvw,
        gt_plants       TYPE qc_werks_range.

  DATA: ls_mara TYPE ty_mara,
        l_index TYPE sy-tabix,         
        ls_mchb TYPE ty_mchb.          
* Call of function to read batch-where-used list
  gs_dfchvw-alstf = '00'.
  gs_dfchvw-kznul = 'X'.
  gs_dfchvw-trfpo = 'X'.
  gs_dfchvw-exptp = 'B'.
  gs_dfchvw-dsptp = 'L'.

  CALL FUNCTION 'CHVW_EXPLODE_ALL'
    EXPORTING
      i_matnr  = matnr
      i_werks  = plant
      i_charg  = batch
      i_dfchvw = gs_dfchvw
    TABLES
      t_shadow = gt_shadow
      t_plants = gt_plants
    EXCEPTIONS
      OTHERS   = 1.


*************
MARA - Material Master
MCHB - Material details on basis of CHARG - mapped to Tcode MMBE*
CHVW - Used Materials details
********

Wednesday, May 9, 2012

Smartform - New Page for each record in table

Tcode: smartforms

Create Smart form say: ZABC_SF
Create Smart style: ZDEF_SS

In main window: Loop at first table as shown in below.

In output options assign Style.
In CODE2: Add following as shown, No condition required here.

In Command Line add following as Shown. This will responsible for creating new page for each record in first Internal table.

Design another table in the list as below.  In Output options mention Style.

Display data of table as below. You are done. Code is to calculate values, dont forget to pass input output values as well
SOST* - Check email if send out from system
NACE*- Conditions for output control > Select output looking for (ie. Billing)
Press 'Output Types' > select output type > double click on processing routine in left.
ADRC -  contains address for address no, which can be configured in smart form
customer table KNA1 have adrc no field in ADRNR.
VA03  - Sales Order > Enter Sales Order No > Issue Output to
VF03 -  Billing > Enter Billing No > Issue Output to

To configure a output :
VA02 > Extras > Output > Header > Edit
To configure the output Following needs to be done in Billing, In VF02 > Enter a Billing doc details, > go to header > Output > Enter details using 'communication details' and 'Further Data'. Request processing set to send immediately i.e. 4
Same for Sales Order > VA02 > Extras > Output > Header > Edit ....

Sample Code - Download Smartform as PDF doc
********
FORM download_smartform_as_pdf .
  DATA : fmname                  TYPE rs38l_fnam,
         st_job_output_info      TYPE ssfcrescl,
         st_document_output_info TYPE ssfcrespd,
         st_job_output_options   TYPE ssfcresop,
         v_e_devtype             TYPE rspoptype,
         st_output_options       TYPE ssfcompop,
         st_control_parameters   TYPE ssfctrlop,
         v_bin_filesize          TYPE i.
  CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
    EXPORTING
      i_language    = 'E'
      i_application = 'SAPDEFAULT'
    IMPORTING
      e_devtype     = v_e_devtype.
  st_output_options-tdprinter = v_e_devtype.
  st_control_parameters-no_dialog = 'X'.
  st_control_parameters-getotf = 'X'.
  IF gt_final IS NOT INITIAL.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname           = 'ZABC_SF'
      IMPORTING
        fm_name            = fmname
      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 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
       gt_final                   = gt_final
       gt_graph                   = gt_graph
    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.
  ENDIF.
*.........................CONVERT TO OTF TO PDF.......................*
* Internal table declaration
  DATA: it_otf      TYPE STANDARD TABLE OF itcoo,
        it_docs     TYPE STANDARD TABLE OF docs,
        it_lines    TYPE STANDARD TABLE OF tline,
        v_guiobj                 TYPE REF TO cl_gui_frontend_services,
        v_uact                   TYPE i,
        v_name                   TYPE string,
        v_path                   TYPE string,
        v_fullpath               TYPE string,
        v_filter                 TYPE string,
        v_filename               TYPE string.

  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
    EXCEPTIONS
      err_conv_not_possible  = 1
      err_otf_mc_noendmarker = 2
      OTHERS                 = 3.
*........................GET THE FILE NAME TO STORE....................*
  CONCATENATE 'smrt' '.pdf' INTO v_name.
  CREATE OBJECT v_guiobj.
  CALL METHOD v_guiobj->file_save_dialog
    EXPORTING
      default_extension = 'pdf'
      default_file_name = v_name
      file_filter       = v_filter
    CHANGING
      filename          = v_name
      path              = v_path
      fullpath          = v_fullpath
      user_action       = v_uact.
  IF v_uact = v_guiobj->action_cancel.
    EXIT.
  ENDIF.
*..................................DOWNLOAD AS FILE....................*
  MOVE v_fullpath TO v_filename.
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      bin_filesize            = v_bin_filesize
      filename                = v_filename
      filetype                = 'BIN'
    TABLES
      data_tab                = it_lines.
ENDFORM.
******

Monday, May 7, 2012

Useful Links

Dynamic Internal Table

http://wiki.sdn.sap.com/wiki/display/ABAP/Dynamic+Internal+table

 Convert smartform to PDF document.
http://wiki.sdn.sap.com/wiki/display/Snippets/Convert+Smartform+to+PDF+format

 Converts spool request into PDF document and emails it to recipicant.
http://wiki.sdn.sap.com/wiki/display/Snippets/Sending++attachment+using+cl_bcs+classes
 http://www.sapdev.co.uk/reporting/rep_spooltopdf.htm

Area Menu
http://scn.sap.com/thread/1522768

How to change the SAP Script Package..when i use option copy from client option, it ask for a package but after copied it shows in the $TMP package...



 Goto the Tcode SE03 and select the option "change object directory entry" and execute. You will get a list of standard ABAP objects. Now select an empty row and give "R3TR" and "FORM" and give your SAP script name in the text box and execute. Here you can change the Package or Development class.

Best for SAP Script
http://www.saptraininghub.com/sap-script/
in SE12 dictionary for TSTC, double click on field type of tcode to switch to the data element. In data element, double-click on domain name. In the domain definition, there is a check-box 'lower case'. If this is checked, lower case values are allowed in input fields. You may check that in SE93 you can enter a transaction name in lower case letters and it is converted to upper case as soon as you press enter.
If you don't have the lower case checked for a domain, you can almost be sure that you won't find lower case in the table. But tables still may have been filled programmatically with lower case entries. This is usually not the case with SAP programs but customers Z programs do it from time to time.

Q. Find purchase order of a material batch added in a delivery for a report re



I create purchase orders in ME21N and do the inbound delivery in VL31N referring the purchase order. Sales order entry is done in VA01 and once goods is in-house allocation is done in J3AB. Outbound delivery is created in VL01N. For a report requirement I need to find the purchase order of the outbound delivery material batches. We donu2019t maintain the purchase order number any ware in the material batch. Please advice me on how to find the purchase order of a material batch added in a delivery.
Ans: use Mb51, enter material number and batch number and movement type 101, then execute. You get the receipt, go into the detail and you will see the PO number. Technically spoken, material movements are stored in MKPF and MSEG table. You can configure the settings in standard SAP by T-code OMBG. Over here you can define your own version which will have only those columns that you want to see in MMBE report.
How to transport ABAP report selection variants



The steps described below are used to transport a report variant. They can be initiated from transaction SE38 (\Tools\ABAP/4 workbench\Development\ABAP/4editor) or transaction SA38 (\System\Services\Reporting).

1. Enter the name of the program the variant is to be transported for.

2. Select menu path \Goto\Variants.

3. Select menu path \Variants\Transport request.

4. Click on the Excecute button (or PF8).

5. You will be prompted with a list and a request to select the variant to be transported. Select the variant(s) to be transported and click on the
'Continue' button.

6. You will be presented with the 'Change Request Query' screen. If a Change Request has already been created for the variant transport skip to Step 8.

7. If a Change Request must be created, select menu path \Request/task\Create. You will be prompted to select a "category" ---> click on the 'Customizing' button. You will be prompted for a description. Enter a description and click on the yellow folder or press 'Enter'.

8. Click on the folder icon to the left of the Change Request to display the related "Tasks". Double click on the "Task" to be used for the variant transport. You will receive the message "The desired entries have been included in D20K90xxxx". Press 'Enter' once you have read the message.

9. When you are ready to release the variant, go to transaction SE10 and release the Change Request following the same steps as for any other Change Request.