Search This Blog

Tuesday, June 23, 2020

JSON to CSV or Excel

https://www.convertcsv.com/json-to-csv.htm

Friday, June 15, 2018

ABAP Database Connectivity


Use ABAP Database Connectivity (ADBC) to select data. ADBC is an API for the Native SQL interface of the AS ABAP that is based on ABAP Objects and is recommended over EXEC SQL. Reference: https://help.sap.com/http.svc/rc/abapdocu_750_index_htm/7.50/en-US/abenadbc.htm


 data: go_exc   type ref to cx_sql_exception,  
      go_conn  type ref to cl_sql_connection,
      c_dbs type dbcon-con_name value 'DBNAME'.    
    
 try.  
    go_conn = cl_sql_connection=>get_connection( con_name = c_dbs ).  
   catch cx_sql_exception into go_exc.  
    gv_text = |{ text-e03 } { c_dbs }|.  
    message gv_text type 'S' display like 'E'.  
    leave list-processing.  
 endtry.  
   
   

Thursday, June 22, 2017

Adding Attachments using GOS and testing a webservice with SOAPUI

SAP Tips:
  • Make SAP import parameter for file type XSTRING
  • Pseudo code:
    • call function 'SCMS_XSTRING_TO_BINARY'
    • Use include and SWC macros to build objects for calling cl_binary_relation->create_link
    • call cl_binary_relation - create_link 
      • Example params:
        • is_object_a-instid = vendor number or custom value
        • is_object_a-typeid = LFA1 or custom value
        • is_object_a-catid = 'BO'
        • is_object_b-instid = swc_get_object_key lo_message  lv_message_key
        • is_object_b-typeid = 'MESSAGE'
        • is_object_b-catid = 'BO'
        • ip_reltype = 'ATTA'


SOAPUI tips:

  • Click on attachments tab and upload attachment
  • Use cid:notation (i.e. cid:) in the element tag
  • Double click on UNKOWN in the TYPE column and select filename
  • Use the drop down in the PART column to select the filename, the TYPE column should change to CONTENT

Change URL to httpS

References:


Note: After adding the attachment and adding the "cid" notation I had to double-click on the "UNKNOWN" type, this somehow allowed me to select the file name under the Part field.

Wednesday, February 01, 2017

Consistency check of ALV Grid - shift + double click

(Shift + Right Double Click) in a grey area of a grid will bring up the Consistency Check of ALV Grid which can be very handy.

Wednesday, February 03, 2016

Remittance Advice Split Lockbox BAI2

Delete statement:

  1. Get KUKEY from table FEBKO where EDATE = today or date of import
  2. Run program RFEBKA96; application = 0003; ID = KUKEY; delete statement

View Lockbox or Checks:
  1. Run /nFLB1; Date = date of file; execute; view other display
  2. Use payt adv number to view table AVIP where AVSID = payt advice

User exit to set split line value:
RFEBLB00->RFEBLB20->EXIT_RFEBLB20_001->ZXF01U3
e_avik-texts = 'SPLT'.
e_avik-vorgc = 500.


The actual split logic is in fm FIEB_SPLIT_LOCKBOX_ADVICE (called by RFEBLB00) on line 116. It basically selects AVIP and totals NEBTR until it gets to 500 lines. If the total is positive it checks the next line up to 500 lines etc. Basically making sure none of the advices will result in a negative amount.

Logic:
  loop at l_avip assigning <avip>.  
   l_nebtr = l_nebtr + <avip>-nebtr.  
   l_lines = l_lines + 1.  
   if l_lines = i_max_lines.  
    if l_nebtr < 0.  
     message s672(fv) raising not_possible.  
    endif.  
    clear l_lines.  
    clear l_nebtr.  
   endif.  
  endloop.  
  if l_nebtr < 0.  
   message s672(fv) raising not_possible.  
  endif.  

Thursday, December 03, 2015

Import and Export to Cluster Databases

http://wiki.scn.sap.com/wiki/display/Snippets/Import+and+Export+to+Cluster+Databases 

Export some data:
1:  REPORT zshukswe19               .  
2:  TABLES indx.  
3:  DATA: int_indx TYPE TABLE OF indx,  
4:     indxkey TYPE indx-srtfd,  
5:     wf_data(11) TYPE c VALUE 'EXPORTCHECK'.  
6:  BREAK-POINT.  
7:  *In this example we will export wf_data to INDX cluster database  
8:  *In other case we can export internal table etc also  
9:  indx-aedat = sy-datum.  
10:  indx-usera = sy-uname.  
11:  indx-pgmid = sy-repid.  
12:  *Let us define a index key (It can be a unique key also)  
13:  indxkey = 'YCHECKID39'.  
14:  EXPORT wf_data FROM wf_data TO DATABASE indx(za)  
15:    ID indxkey.  
16:  BREAK-POINT.  
Import the data exported:
1:  REPORT zshukswe20               .  
2:  TABLES indx.  
3:  DATA: int_indx TYPE TABLE OF indx,  
4:     indxkey TYPE indx-srtfd,  
5:     wf_data(11) TYPE c.  
6:  BREAK-POINT.  
7:  indxkey = 'YCHECKID39'.  
8:  IMPORT wf_data TO wf_data FROM DATABASE indx(za) ID indxkey.  
Delete values from cluster table:
1:  REPORT zshukswe21               .  
2:  TABLES indx.  
3:  DATA: int_indx TYPE TABLE OF indx,  
4:     indxkey TYPE indx-srtfd,  
5:     wf_data(11) TYPE c.  
6:  BREAK-POINT.  
7:     
8:  indxkey = 'YCHECKID39'.  
9:  DELETE FROM DATABASE indx(za) ID indxkey.  
10:  BREAK-POINT.  

Thursday, October 22, 2015

Lock program or bogus object prevent program from running multiple times simultaneously E_DSVAS_TRDIR

 TYPE-POOLS:abap.  
   
 DATA:lock TYPE boolean.  
   
 PARAMETERS: pa_chr TYPE char12.  
   
 INITIALIZATION.  
   
  IF lock = abap_off.  
   PERFORM enqueue_program.  
  ELSE.  
   PERFORM dequeue_program.  
  ENDIF.  
   
 START-OF-SELECTION.  
   
  WRITE :/ 'Processing Starts'.  
  WRITE :/ 'Program locked'.  
  WRITE :/ 'This program will not be allowed to be executed by multiple'.  
  WRITE :/ 'Users in the same time'.  
   
 FORM enqueue_program .  
   
  CALL FUNCTION 'ENQUEUE_E_DSVAS_TRDIR'  
   EXPORTING  
    mode_trdir   = 'X'  
    name      = sy-repid  
    x_name     = ' '  
    _scope     = '2'  
    _wait     = ' '  
    _collect    = ' '  
   EXCEPTIONS  
    foreign_lock  = 1  
    system_failure = 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.  
  ELSE.  
   lock = abap_on.  
  ENDIF.  
   
 ENDFORM.          " ENQUEUE_PROGRAM  
   
 FORM dequeue_program .  
    
 lock = abap_off.  
   
  CALL FUNCTION 'DEQUEUE_E_DSVAS_TRDIR'  
   EXPORTING  
    mode_trdir = 'X'  
    name    = sy-repid  
    x_name   = ' '  
    _scope   = '3'  
    _synchron = ' '  
    _collect  = ' '.  
   
 ENDFORM.          " DEQUEUE_PROGRAM  

Wednesday, October 21, 2015

Embed code

http://codeformatter.blogspot.com/

Describe field, structure, table, ddic object

 form set_header using  iv_delim type char1  
          changing es_header type string.  
   
  data: lv_ddobj type ddobjname value 'ZPWORKDAY_EXTRACT'.  
  data: lt_str type standard table of dfies.  
  field-symbols: <str> type dfies.  
   
  call function 'DDIF_FIELDINFO_GET' "to get structure field details  
   exporting  
    tabname    = lv_ddobj  
   tables  
    dfies_tab   = lt_str  
   exceptions  
    not_found   = 1  
    internal_error = 2  
    others     = 3.  
   
  loop at lt_str assigning <str>.  
   if es_header is initial.  
    es_header = <str>-fieldtext.  
   else.  
    concatenate es_header iv_delim <str>-fieldtext into es_header.  
   endif.  
  endloop.  
   
 endform.          " SET_HEADER     
 
DATA: lv TYPE fmglflexa.  
   
 DATA: typ1,  
    comp1 TYPE i,  
    typ2,  
    comp2 TYPE i.  
 DATA: td    TYPE sydes_desc.  
   
 DESCRIBE FIELD lv TYPE typ1 COMPONENTS comp1.  
 DESCRIBE FIELD lv INTO td.  

Thursday, June 05, 2014

Adobe livecycle hide field

Hide field when blank:
initialize javascript:

if(CUST_MAT_DESC.rawValue == null
  CUST_MAT_DESC.presence = "hidden"; 

}

Wednesday, June 04, 2014

Adobe Livecycle PDF Page Break

1) Select your repeating subform and add a Conditional Break (Object,Pagination,Edit...).
2) Enter this script: this.instanceManager.count > this.instanceIndex+1
3) Select Break: After and To: Top of Next Page

Wednesday, April 09, 2014

Monday, March 31, 2014

VA02 copy item text

When you change the material, SAP deletes all the texts and re-determines the material sales text.  I think the text re-determined is based on config – not really important for what I was doing.  Anyway SAP deletes the texts and re-determines almost immediately making it impossible to capture the previous text in a user exit.

Solution:

I ended up having to do a mod right before SAP deletes the texts (in FV45TF0P_POSTEXT_LOESCHEN_EINZ).  Basically I only let SAP delete the texts I want re-determined (i.e. id = ‘0001’).

Wednesday, February 26, 2014

ENHANCEMENT188: BAdI definition ME_CHANGE_OUTTAB is only provided for SAP internal use

  1. SE18
  2. Enter BADI name ME_CHANGE_OUTTAB and press the "Change"
  3. In the "Type" Pane, uncheck "Within SAP" checkbox
  4. Save
Sample code:
  FIELD-SYMBOLS: TYPE merep_outtab_eban.

  IF im_struct_name = 'MEREP_OUTTAB_EBAN'.
    LOOP AT ch_outtab ASSIGNING .
      SELECT        dismm FROM  marc INTO -zzdismm
             WHERE  matnr  = -matnr
             AND    werks  = -werks.
      ENDSELECT.
    ENDLOOP.
  ENDIF.


Tuesday, August 06, 2013

Smartforms Page x of y

Try using (3ZC). Length 3, suppress zero, consolidate. Page: &SFSY-PAGE& of &SFSY-FORMPAGES(3ZC)&

Thursday, May 09, 2013

How to create parallel/side-by-side dynamic tables in Adobe Lifecyle

Is it possible to create parallel/side-by-side dynamic tables in Adobe Lifecyle? If so, how? Since the tables have different sizes I am running into wrapping issues with flowed western text setting and paging issues with position control. Any other ideas? Solution: I had actually tried this solution ("wrapping the tables in a position subform and setting it to auto-fit height and allow page breaks.") but it didn't work. Something to do with nested position subforms inside a flow control subform etc. So to get it to work, I set the page to be a position subform and set auto-height and allow page breaks and I unwrapped the tables so they were only "wrapped" by the page itself. http://forums.adobe.com/message/5288482#5288482

Tuesday, March 26, 2013

Tuesday, December 11, 2012

How to Embed sample code in blogger

http://codeformatter.blogspot.com/

Simple sflight XSLT transformation for HTML

 <?sap.transform simple?>  
 <!-- NOTE!! For XSLT reference check http://www.w3schools.com/xsl/default.asp -->  
 <tt:transform xmlns:tt="http://www.sap.com/transformation-templates" xmlns:ddic="http://www.sap.com/abapxml/types/dictionary" xmlns:def="http://www.sap.com/abapxml/types/defined" version="1.0">  
 <!-- <tt:root name="ROOT" type="?"/>-->  
  <tt:root name="GT_OUT" type="ddic:TY_FLIGHTS"/>  
  <tt:template>  
   <HTML>  
    <HEAD>  
     <style>  
       .col {  
          border-width: 1px;  
          padding: 7px;  
          border-style: solid;  
          border-color: #DDDDDD;  
          border-collapse:collapase;  
          }  
        .t2 {  
           border-width: 0px;  
          }  
      .space {  
          padding-bottom: 3em;  
          }  
    .myTable2  {  
           font-family: arial;  
           font-size:10pt;  
           width:100%;  
           border-style:solid;  
           border-width: 1px;  
           border-color: #424242;  
           border-collapse: collapse;  
          }  
    .myTable2 th.p {width:7%;color="red";}  
    .myTable2 th.m {width:24%;}  
    .myTable2 th.a {width:34%;}  
    .myTable2 th.k {width:13%;}  
    .myTable2 th.n {width:13%;}  
    .myTable2 th  
          { background-color:#A9D0F5;  
           padding:2px;  
           border:1px solid #424242;  
          }  
    .myTable2 td.p {width:7%;color="red";}  
    .myTable2 td.m {width:24%;}  
    .myTable2 td.a {width:34%;}  
    .myTable2 td.k {width:13%;}  
    .myTable2 td.n {width:13%;}  
    .myTable2 td  
          { padding:2px;  
           border:1px solid #424242;  
          }  
    .myTable2 tr {  
           border-style:solid;  
           border-width:1px;  
           border-color:#dee3ef;  
          }  
     </style>  
    </HEAD>  
    <BODY>  
     <img alt="Allergan" src="https://allergandirect.allergan.com:81/Document/images/image_agn.bmp" width="200"/>  
     <BR/>  
     <H2 align="center">  
      <font color="red">  
       DEMO: Use XSLT to create XLS attachment  
       <BR/>  
       Warning: Size of attachment can get large  
      </font>  
     </H2>  
     <H2>  
      This email was produced by program ZZFLOTH_TRANS_EMAIL_XLS_HTM  
     </H2>  
     <H3>  
      Email Attachment XSLT: ZZFLOTH_TRANS_XLS  
     </H3>  
     <H3>  
      Email Body XSLT: ZZFLOTH_TRANS_HTM  
     </H3>  
     <BR/>  
     <table class="myTable2">  
      <tr>  
       <th class="p">Airline Code</th>  
       <th class="m">Flight Connection</th>  
       <th class="a">Flight date</th>  
       <th class="k">Currency</th>  
       <th class="n">Airfare</th>  
      </tr>  
      <tt:loop ref=".GT_OUT">  
       <tr>  
        <td class="p">  
         <tt:value ref="$ref.CARRID"/>  
        </td>  
        <td class="m">  
         <tt:value ref="$ref.CONNID"/>  
        </td>  
        <td class="a">  
         <tt:value ref="$ref.FLDATE"/>  
        </td>  
        <td class="k">  
         <tt:value ref="$ref.CURRENCY"/>  
        </td>  
        <td class="n">  
         <tt:value ref="$ref.PRICE"/>  
        </td>  
       </tr>  
      </tt:loop>  
     </table>  
     <BR/>  
    </BODY>  
   </HTML>  
  </tt:template>  
 </tt:transform>  

Simple sflight XSLT transformation for EXCEL

 <?mso-application progid="Excel.Sheet"?>  
 <?sap.transform simple?>  
 <tt:transform xmlns:tt="http://www.sap.com/transformation-templates" xmlns:ddic="http://www.sap.com/abapxml/types/dictionary" xmlns:def="http://www.sap.com/abapxml/types/defined" version="1.0">  
  <tt:root name="ROOT" type="?"/>  
  <tt:root name="GT_OUT" type="ddic:TY_FLIGHTS"/>  
  <tt:template>  
   <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html=  
 "http://www.w3.org/TR/REC-html40">  
    <!--   <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">  
     <Author>authorname</Author>  
     <LastAuthor>authorname</LastAuthor>  
     <Created>2012-02-01T10:12:47Z</Created>  
     <Company/>  
     <Version>12.00</Version>  
    </DocumentProperties>-->  
    <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">  
     <!-- <ReadOnlyRecommended/>-->  
    </OfficeDocumentSettings>  
    <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">  
     <WindowHeight>11055</WindowHeight>  
     <WindowWidth>19155</WindowWidth>  
     <WindowTopX>0</WindowTopX>  
     <WindowTopY>120</WindowTopY>  
     <ProtectStructure>False</ProtectStructure>  
     <ProtectWindows>False</ProtectWindows>  
    </ExcelWorkbook>  
    <Styles>  
     <Style ss:ID="Default" ss:Name="Normal">  
      <Alignment ss:Vertical="Bottom"/>  
      <Borders/>  
      <Font ss:Color="#000000" ss:FontName="Arial" ss:Size="12" x:Family="Swiss"/>  
      <Interior/>  
      <NumberFormat/>  
      <Protection/>  
     </Style>  
     <Style ss:ID="hdr">  
      <Alignment ss:Horizontal="Center"/>  
      <Borders>  
       <Border ss:Position="Left" ss:Color="#000000" ss:LineStyle="Continuous" ss:Weight="1"/>  
       <Border ss:Position="Right" ss:Color="#000000" ss:LineStyle="Continuous" ss:Weight="1"/>  
       <Border ss:Position="Top" ss:Color="#000000" ss:LineStyle="Continuous" ss:Weight="1"/>  
       <Border ss:Position="Bottom" ss:Color="#000000" ss:LineStyle="Continuous" ss:Weight="1"/>  
      </Borders>  
      <Font ss:Bold="1" ss:Size="20"/>  
      <Interior ss:Color="#A9D0F5" ss:Pattern="Solid"/>  
     </Style>  
     <Style ss:ID="key">  
      <Borders>  
       <Border ss:Position="Left" ss:Color="#000000" ss:LineStyle="Continuous" ss:Weight="1"/>  
       <Border ss:Position="Right" ss:Color="#000000" ss:LineStyle="Continuous" ss:Weight="1"/>  
       <Border ss:Position="Top" ss:Color="#000000" ss:LineStyle="Continuous" ss:Weight="1"/>  
       <Border ss:Position="Bottom" ss:Color="#000000" ss:LineStyle="Continuous" ss:Weight="1"/>  
      </Borders>  
      <Font ss:Bold="1" ss:Size="20"/>  
      <Interior ss:Color="#C0C0C0" ss:Pattern="Solid"/>  
     </Style>  
     <Style ss:ID="12r">  
      <Font ss:Bold="1" ss:Color="red"/>  
     </Style>  
     <Style ss:ID="s62">  
      <Protection/>  
     </Style>  
    </Styles>  
    <Worksheet ss:Name="SFLIGHT" ss:Protected="0">  
     <Table x:FullColumns="1" x:FullRows="1">  
 <!--AutofitWidth only works on datetime/numeric fields     -->  
 <!--     <Column ss:AutoFitWidth="1"/>-->  
 <!--     <Column ss:AutoFitWidth="1"/>-->  
      <Column ss:Width="125"/>  
      <Row ss:AutoFitHeight="1" ss:StyleID="hdr">  
       <Cell>  
        <Data ss:Type="String">Airline Code</Data>  
       </Cell>  
       <Cell>  
        <Data ss:Type="String">Connection</Data>  
       </Cell>  
       <Cell>  
        <Data ss:Type="String">Date</Data>  
       </Cell>  
       <Cell>  
        <Data ss:Type="String">Curr</Data>  
       </Cell>  
       <Cell>  
        <Data ss:Type="String">Airfare</Data>  
       </Cell>  
      </Row>  
      <tt:loop ref=".GT_OUT">  
       <Row ss:AutoFitHeight="1">  
        <Cell ss:StyleID="key">  
         <Data ss:Type="String">  
          <tt:value ref="$ref.CARRID"/>  
         </Data>  
        </Cell>  
        <Cell ss:StyleID="12r">  
         <Data ss:Type="String">  
          <tt:value ref="$ref.CONNID"/>  
         </Data>  
        </Cell>  
        <Cell>  
         <Data ss:Type="String">  
           <tt:value ref="$ref.FLDATE"/>  
         </Data>  
        </Cell>  
        <Cell>  
         <Data ss:Type="String">  
          <tt:value ref="$ref.CURRENCY"/>  
         </Data>  
        </Cell>  
        <Cell>  
         <Data ss:Type="Number">  
          <tt:value ref="$ref.PRICE"/>  
         </Data>  
        </Cell>  
       </Row>  
      </tt:loop>  
     </Table>  
 <!--    <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">  
      <PageSetup>  
       <Header x:Margin="0.3"/>  
       <Footer x:Margin="0.3"/>  
       <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>  
      </PageSetup>  
      <Unsynced/>  
      <Print>  
       <ValidPrinterInfo/>  
       <HorizontalResolution>600</HorizontalResolution>  
       <VerticalResolution>600</VerticalResolution>  
      </Print>  
      <Selected/>  
      <Panes>  
       <Pane>  
        <Number>3</Number>  
        <ActiveRow>22</ActiveRow>  
        <ActiveCol>2</ActiveCol>  
       </Pane>  
      </Panes>  
      <ProtectObjects>True</ProtectObjects>  
      <ProtectScenarios>True</ProtectScenarios>  
     </WorksheetOptions>-->  
    </Worksheet>  
   </Workbook>  
  </tt:template>  
 </tt:transform>  

Zip file/attachment cl_abap_zip

 *Use cl_abap_zip to zip file(s) for download or email    
  DATA: g_zip TYPE REF TO cl_abap_zip.    
     
  CREATE OBJECT g_zip.    
     
  CONCATENATE 'File1' '.xls' INTO im_type.    
     
  CALL METHOD g_zip->add    
   EXPORTING    
   name = im_type    
   content = l_xstring.    
     
  CALL METHOD g_zip->save    
  RECEIVING    
  zip = gs_zip.   

Wednesday, November 14, 2012

Update extended custom fields in material master MARA, MARC, MARD using BAPI BAPI_MATERIAL_SAVEDATA

  1. Add custom field ZZ_whatever to MARC using append structure
  2. Extend structure BAPI_TE_MARC, BAPI_TE_MARCX with the same field.  (possibly extend BAPI_TE_E1MARC and BAPI_TE_E1MARCX as well).
  3. Use transaction OMSR to add the new custom fields to the field selection group(i.e.240)

Populate extensionin and extensioninx and pass to BAPI.

For example:

data: ext    type BAPIE1PAREX,
        ext_x type BAPIE1PAREXX,
        ls_marc  type BAPI_TE_MARC,
        ls_marcx type BAPI_TE_MARCX.

ls_marc-material = matnr.
ls_marc-plant      = werks.
ls_marc-zz_whatever = whatever.


ls_marcx-material = matnr.
ls_marcx-plant      = werks.
ls_marcx-zz_whatever = 'X'.

ext-function = 'UPD'.
ext-material = matnr.
ext-structure = 'BAPI_TE_MARC'
ext-valuepart1 = LS_MARC

ext_x-function = 'UPD'.
ext_x-material = matnr.
ext_x-structure = 'BAPI_TE_MARCX'.
ext_x-valuepart1 = LS_MARCX

append ext to lt_ext.
append ext_x to lt_ext_x.



    CALL FUNCTION 'BAPI_MATERIAL_SAVEREPLICA'
      EXPORTING
        noappllog            = ' '
        nochangedoc          = ' '
        testrun              = i_test
        inpfldcheck          = ' '
      TABLES
        headdata             = lt_header
        clientdata           = lt_material
        clientdatax          = lt_material_x
        plantdata            = lt_plant_data
        plantdatax           = lt_plant_data_x
        planningdata         = lt_planning_data
        planningdatax        = lt_planning_data_x
        storagelocationdata  = lt_storageloc
        storagelocationdatax = lt_storagelocx
        valuationdata        = lt_valuation_data
        valuationdatax       = lt_valuation_data_x
        salesdata            = lt_sales_data
        salesdatax           = lt_sales_data_x
        taxclassifications   = lt_tax_data
        materialdescription  = lt_description
        materiallongtext     = lt_longtext
        unitsofmeasure       = lt_mat_uom
        unitsofmeasurex      = lt_mat_uom_x
        extensionin          = lt_ext
        extensioninx         = lt_ext_x
        returnmessages       = lt_return.



Tuesday, October 09, 2012

Use field-symbol to move-corresponding


FORM update_data  USING    im_input
                  CHANGING ch_output.


  DATA: ob_desc  TYPE REF TO cl_abap_structdescr.
  DATA: i_in  TYPE abap_compdescr_tab.
  DATA: i_out TYPE abap_compdescr_tab.
  DATA: l_value(40).

  FIELD-SYMBOLS:
TYPE LINE OF abap_compdescr_tab.
  FIELD-SYMBOLS: TYPE ANY,
                 TYPE ANY.


* Determine Structures
  ob_desc ?= cl_abap_typedescr=>describe_by_data( im_input ).
  i_in[] = ob_desc->components[].
  ob_desc ?= cl_abap_typedescr=>describe_by_data( ch_output ).
  i_out[] = ob_desc->components[].

* Move input to output check nodata
  LOOP AT i_in ASSIGNING
.
    ASSIGN COMPONENT
-name OF STRUCTURE im_input TO .
    IF sy-subrc = 0.
      l_value = .
      IF l_value <> c_nodata.
        ASSIGN COMPONENT
-name OF STRUCTURE ch_output TO .
        IF sy-subrc = 0.
          = .
        ENDIF.
      ENDIF.
    ENDIF.
  ENDLOOP.

ENDFORM.                    " UPDATE_DATA

Monday, October 01, 2012

SAP Excel Stuff

RSDEMO01

cl_ixml=>create
if_ixml_stream_factory

ALSM_EXCEL_TO_INTERNAL_TABLE
TEXT_CONVERT_XLS_TO_SAP


cl_salv_table->to_xml


data: g_salv type ref to cl_salv_table.

*Build your normal ALV output, I recommend not executing display() method until the end of the program though.

perform build_alv using itab space ps_var.

*Converts your ALV to xstring

x_mhtml = g_salv->to_xml( xml_type = '02'

xml_flavour = if_salv_bs_c_tt=>c_tt_xml_flavour_export ).



*Convert xstring so it can be attached to an email

try.

ct_bin = cl_bcs_convert=>xstring_to_solix( iv_xstring = x_mhtml ).

ch_size = xstrlen( x_mhtml ).

catch cx_bcs.

message e445(so).

endtry.

Tuesday, June 19, 2012

SAPGUI Chinese Character Set


Windows XP:
control panel->regional and language options -> language -> install east asian language

Thursday, May 31, 2012

Additional WRITE options: http://help.sap.com/abapdocu_702/en/abapwrite_to_options.htm#!ABAP_ADDITION_12@12@

Friday, May 25, 2012

Browser in sapgui. See program SAPHTML_DEMO1

Tuesday, February 28, 2012

View Cluster

SE11
Create table
Create view
Generate maintenance view for view

SE54
Create view cluster
Enter view name under enter object structure


Thursday, January 26, 2012

Modify COOIS

Notes on how to add custom ALV fields to COOIS and handle custom double click event.

Objects to modify:
BAdI:

  • WORKORDER_INFOSYSTEM

Tables:

  • CT_IOHEADER-CI_IOHEADER
  • T354T
  • T354S
Program:
  • RCOTX000



Steps:

  1. Add custom fields to appropriate structure (i.e. CI_IOHEADER)
  2. Create BAdI implementation for WORKORDER_INFOSYSTEM (i.e. ZCL_IM_PP_HEADER)
  3. Edit appropriate method w/in the implementation (i.e. modify_table_layout)
  4. Handle Events
    1. Modify table T354T and T354S
  5. Modify field catalog
    1. execute RCOTX000 for appropriate structure (i.e. IOHEADER or IOOPER)

Friday, November 11, 2011

ALV OM Header / Footer alignment

The class for controlling alignment in the header/footer is cl_salv_form_layout_data_grid.

Example:
data: lr_grid type ref to cl_salv_form_layout_grid,
lr_layout_grid type ref to cl_salv_form_layout_data_grid,
lr_label type ref to cl_salv_form_label.

lr_label = lr_grid->create_label(
row = 1
column = 1
colspan = 4
text = 'Net Profit Report'(h01)
tooltip = text-h01 ).

lr_layout_grid ?= lr_label->get_layout_data( ).
lr_layout_grid->set_h_align( if_salv_form_c_h_align=>center ).

PFSTATUS SE41

SAPLKKBL is a good program to copy pf status from.

Tuesday, October 25, 2011

Select data from a SET

DATA: p_range LIKE TABLE OF range_c24 WITH HEADER LINE.
DATA: set_values LIKE rgsb4 OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'G_SET_GET_ALL_VALUES'
EXPORTING
setnr = 'Z-BUKRS'
class = '0000'
TABLES
set_values = set_values.

LOOP AT set_values.
CLEAR p_range.
p_range-sign = 'I'.
IF set_values-from = set_values-to.
p_range-option = 'EQ'.
ELSE.
p_range-option = 'BT'.
p_range-high = set_values-to.
ENDIF.
p_range-low = set_values-from.
APPEND p_range.
ENDLOOP.

Wednesday, September 28, 2011

Refresh Select Options

  "refresh select option for ME22.
  DATA: l_rspar_tab  TYPE STANDARD TABLE OF rsparams. 
  CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
  EXPORTING
    curr_report     = 'SAPMM06E'
  TABLES
    selection_table = l_rspar_tab.

Tuesday, August 02, 2011

Break down a file to deal with excel upload function row limitation

report ZZFLOTH_TEMP.

DATA: BEGIN OF file_chunks OCCURS 0,
        file LIKE rlgrap-filename,
        rowb TYPE i,
        rowe TYPE i,
      END OF file_chunks.

SELECTION-SCREEN BEGIN OF BLOCK block1
           WITH FRAME TITLE text-001.
PARAMETERS: p_bdc   LIKE apqi-groupid OBLIGATORY
                    DEFAULT 'ZB01yyyymmdd',
            p_file  LIKE rlgrap-filename OBLIGATORY
                    DEFAULT 'c:\exclusions.xls',
            p_row_bg  TYPE i OBLIGATORY,
            p_recs TYPE i DEFAULT 20000 OBLIGATORY.
SELECTION-SCREEN END OF BLOCK block1.

START-OF-SELECTION.
** Import XLS
  perform read_xls.
  end-of-SELECTION.

*&---------------------------------------------------------------------*
*&      Form  read_xls
*&---------------------------------------------------------------------*
*       read xls file
*----------------------------------------------------------------------*
FORM read_xls .
  DATA:  xls LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.

* Break input files into chunks of 9000 rows.  The function can
* only handle 9999 rows.
  REFRESH file_chunks.
  PERFORM create_file_chunks USING p_file p_row_bg p_recs.

  LOOP AT file_chunks.
    REFRESH xls.
    IF NOT file_chunks-file IS INITIAL.

      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename    = file_chunks-file
          i_begin_col = 1
          i_begin_row = file_chunks-rowb
          i_end_col   = 2
          i_end_row   = file_chunks-rowe
        TABLES
          intern      = xls
        EXCEPTIONS
          OTHERS      = 3.
      IF sy-subrc <> 0.
        MESSAGE e212(zz) WITH p_file.
      ENDIF.
    ENDIF.

    SORT xls BY row col.

    LOOP AT xls.

      CASE xls-col.
        WHEN 1.
          "record-kunnr  = xls-value.
        WHEN 2.
          "record-ktokd  = xls-value.
        WHEN OTHERS.
      ENDCASE.

      AT END OF row.
        "APPEND record.
        "CLEAR record.
      ENDAT.

    ENDLOOP.
  ENDLOOP.

ENDFORM.                    " read_xls

*&---------------------------------------------------------------------*
*&      Form  create_file_chunks
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*       Determine the file chunks that will be read.  No more than
*       9000 records at a time.
*----------------------------------------------------------------------*
FORM create_file_chunks USING file
                              rowb
                              rowe.
  DATA: chunks TYPE i,
        last TYPE i,
        rowbegin TYPE i.

  CLEAR file_chunks.

  CHECK NOT file IS INITIAL.

  file_chunks-file = file.
  rowbegin = rowb.

* Culculate the full chunks of 9000.
  chunks = rowe DIV 9000.
* Calculate the size of the last chunk.
  last = rowe MOD 9000.

* Add the full 9000 chunks
  DO chunks TIMES.
    file_chunks-rowb = rowbegin.
    ADD 9000 TO rowbegin.
* Adjust to account for the  first row.
    file_chunks-rowe = rowbegin - 1.
    APPEND file_chunks.
  ENDDO.

* Add the pertial chunk.
  IF NOT last IS INITIAL.
    file_chunks-rowb = rowbegin.
    ADD last TO rowbegin.
* Adjust to account for the  first row.
    file_chunks-rowe = rowbegin - 1.
    APPEND file_chunks.
  ENDIF.
ENDFORM.                    " create_file_chunks

PDF Forms Notes

Config:
/nOPK8 - config for PDF forms
/spro -> Quality Management -> Quality Notifications -> Notification Processing -> print control -> define shop papers, forms, print programs

/nCO02

/nSFP

refresh form:
FP_GENERATE_FUNCTION_MODULE

Thursday, April 28, 2011

Set Color to System

  1. Customize Local Layout (ALT+F12)
  2. Design Settings
    1. Set Active Theme to "Enjoy", Apply
  3. Logout and restrat SAPGUI
  4. Customize Local Layout (ALT+F12)
  5. Set Color to System

Friday, April 01, 2011

GUI_UPLOAD ASCII special chars causing problems

If you use GUI_UPLOAD to import an ASCII file and the data has embedded CR or other chars.  Try this using filetype = BIN.


    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename                = g_pc_file
        filetype                = 'BIN'
      IMPORTING
        filelength              = filelength
      CHANGING
        data_tab                = lt_bin
      EXCEPTIONS
        OTHERS                  = 19.
    IF sy-subrc <> 0 OR lt_bin[] IS INITIAL.
      RAISE EXCEPTION TYPE lcl_my_exception.
    ENDIF.


    CALL FUNCTION 'SCMS_BINARY_TO_STRING'
      EXPORTING
        input_length = filelength
      IMPORTING
        text_buffer  = ls_string
      TABLES
        binary_tab   = lt_bin
      EXCEPTIONS
        OTHERS       = 2.
    IF sy-subrc <> 0 .
      RAISE EXCEPTION TYPE lcl_my_exception.
    ENDIF.

    SPLIT ls_string AT cl_abap_char_utilities=>cr_lf INTO TABLE ex_raw_tab.

Wednesday, December 15, 2010

How to create a WSDL / webservice:

How to create a WSDL / webservice:

1. Create RFC enabled function.

2. Create webservice:
a. SE37 -> Utilities -> more Utilities -> create webservice -> from function module
b. Follow the on-screen prompts (give the service a name, usually the same name as FM; X-Mapping der Namen; SOAP Application: soap:runtime:rfc:710; Profie: PRF_DT_IF_SEC_NO; X-Deploy Service)

3. Create WSDL:
a. /nSOAMANAGER -> Application and Scenario Communication
b. -> Single Service Administration
c. -> Search for your service -> Select it and click apply
d. -> Open WSDL document for selected binding, change WSDL Format to"Standard"
e. Save XML locally (this is the WSDL)

4. Maintain service:
a. /nSICF -> enter “service name” -> execute
b. Double click on lowest node and setup “logon data”

5. Test using SOAPUI
a. Download SOAPUI freeware and install
b. File -> New soapUI Project
c. Enter “Project Name” and location your WSDL saved in step 3.e -> ok
d. Open up request -> update XML with input -> click green arrow to run

Change function module / webservice:

6. If you have made changes to the interface of your FM:
a. SE80 -> Edit Object -> Enterprise Services
b. -> enter service name in Service Definition
c. -> change -> activate

7. Repeat steps 3-5.


Wednesday, November 10, 2010

debug batch

How do I debug completed background process?
You can do this only after the job has finished execution. This will simulate the exact background scenario with the same selection screen values as used in the job and sy-batch set to 'X'.
  • Use SM37 to get list of jobs, put the cursor on the job, type JDBG in the command line ( no '/' ), and press ENTER
  • You are in debug mode now. Step through SAP program (press F7 couple of times) until you get to code you need.
  • Note: though running interactively, you can see that sy-batch = 'X'.

More ABAP debugger options - http://wiki.sdn.sap.com/wiki/display/ABAP/ABAP+Debugger

Thursday, October 28, 2010

Forms print in color and ALV does not.

Set your device type to "color".  Otherwise, Smartform and SAPscript creates what is called an OTFPOST data type.  This datatype contains the color inside the file sent to the printer.  That is why we can print the color statement and not ALV in color.

Wednesday, October 06, 2010

Add selection box to ALV OM

*--- Selection box
data: lr_selections type ref to cl_salv_selections
lr_selections = gr_table->get_selections( ).
lr_selections->set_selection_mode( if_salv_c_selection_mode=>row_column ).
 
See report:
SALV_DEMO_TABLE_SELECTIONS

Thursday, September 09, 2010

Friday, August 20, 2010

OO ALV OM and other sample programs

Check out the new ALV OM:  cl_salv_table=>factory

Sample programs in SAP:
SALV_DEMO_TABLE_REAL_SIMPLE
SALV*  "New OM stuff
BALV*  "old school

 /nABAPDOCU  "abap documentation and examples

SE80->Package = SABAPDEMOS

ALV Object Model - Simple 2D Table - The Basics
ALV Object Model - Simple 2D Table - Event Handling
ALV Object Model - Hierarchical Sequential List - The Basics
SAP Help

Friday, May 28, 2010

Dialog Programming Samples /nBIBS

See transaction: BIBS

Basic Table Control example:
http://www.sapdev.co.uk/dialog/tabcontrol/tc_basic.htm


SAP Help:
http://help.sap.com/saphelp_sm32/helpdata/en/45/adee2396f711d1b46b0000e8a52bed/frameset.htm

Monday, February 22, 2010

FI - Terms

Balance Sheet (OB58, S_ALR_87012279) - summary of a company's balances. Snap shot of a company's financial condition. Assets, Liabilities, Equity (Equity = Assets - Liabilities or Assets = Liabilities + Equity).
Assets: Cash, AR, property, equipment...
Liabilities: AP, provisions, bonds/notes, tax...
Equity: capital stock, retained earnings...

GL - record of business transactions.
Special Purpose Ledger - Used for reporting. User defined.
Reconciliation Account - type of GL account that summarizes sub-ledger accounts.
Subledger - provides the details behind the reconciliation account

Chart of Accoutns - list of GL accounts
1000 Assests
2000 Liabilities
3000 Equity
4000 Revenue
5000 Cost of goods sold
6000 Expense
7000 Other revenue (interest income)
8000 Other expense (income tax) 

Document type - identifies business transactions.  General Ledger Accounting Document, Customer Invoice, Customer Payment, Credit Memo, Vendor Invoice, Vendor Payment, Billing document...


Wednesday, December 09, 2009

Translate SFP - Adobe Form

To successfully perform translation, change SAPGUI Language to Japanese and use Goto…Translation and update appropriate tags.

Wednesday, July 01, 2009

Order to Cash

  1. Quotation
  2. Sales Order
    1. Credit check, availability check
  3. Delivery
    1. Picking
    2. Packing
    3. Ship
    4. Post goods Issue
  4. Billing
  5. Payment
  1. VA21 - Quotation
  2. VA01 - Order
  3. VKM3 - release hold
  4. VL01N - Pick/Pack/Ship/PGI
  5. VF01 - Billing
  6. FCC1 - Settlement

Friday, October 31, 2008

Print Selection Screen Criteria

DATA: BEGIN OF mtab_sel_options OCCURS 0,
flag(1) TYPE c,
olength TYPE x,
line LIKE rsvar-infoline,
END OF mtab_sel_options.

CALL FUNCTION 'RS_COVERPAGE_SELECTIONS'
EXPORTING
report = sy-repid
variant = ''
no_import = ''
TABLES
infotab = mtab_sel_options
EXCEPTIONS
error_message = 1
variant_not_found = 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.

loop at mtab_sel_options.
write: / mtab_sel_options-line.
endloop.

Tuesday, July 08, 2008

Serial controlled products - config lookup

ranges: r_sernp for t377p-serail.

* build selection option values macro
define m_sel_opt.
&5-sign = &1.
&5-option = &2.
&5-low = &3.
&5-high = &4.
append &5.
end-of-definition.

select serail into r_sernp-low
from t377p
where eqtyp = 'S'.
** append value to range
m_sel_opt: 'I' 'EQ' r_sernp-low '' r_sernp.
endselect.

***NOW THIS RANGE IS READY TO USE FOR YOUR MARC LOOKUP
SELECT *FROM MARCWHERE SERNP IN R_SERNP.

Thursday, July 03, 2008

Convert Hexadecimal to Binary to Decimal, Bin to Hex, Hex to Dec

*--- hex to binary
data: b(1) type n,
l_hex type xstring,
l_bin type string.

DO.
GET BIT sy-index OF l_hex INTO b.
IF sy-subrc <> 0. EXIT. ENDIF.
CONCATENATE l_bin b INTO l_bin.
CONDENSE l_bin NO-GAPS.
ENDDO.
write: / l_bin.

*--- Binary to Dec
DATA : dig_c(1) TYPE c,
dig_i TYPE i,
s_bin TYPE string,
l TYPE i,
l_exp TYPE p,
l_dec TYPE p,
c TYPE i.

clear: dig_c, dig_i, s_bin, l, l_exp, l_dec, c.

s_bin = l_bin.
l = strlen( s_bin ).
c = l - 1.
do l times.
dig_c = s_bin.
dig_i = dig_c.
l_exp = 2 ** c .
l_dec = l_dec + dig_i * l_exp.
shift s_bin.
c = c - 1.
enddo.
write: / l_dec.

*--- Bin to Hex test
DATA hex(3) TYPE x.
SET BIT: 09 OF hex TO 1,
10 OF hex TO 0,
11 OF hex TO 1,
12 OF hex TO 1,
13 OF hex TO 0,
14 OF hex TO 1,
15 OF hex TO 0,
16 OF hex TO 1.
WRITE hex.

*--- Hex to Dec test
DATA: l_hex TYPE xstring.
DATA l_int TYPE i.
l_hex = '123BCA'.
l_int = l_hex.
WRITE: / 'Hex:', l_hex.
WRITE: / 'Dec:', l_int.

Additional info:
http://help.sap.com/saphelp_nw04/helpdata/en/b6/e7d716f46711d195200000e8353423/frameset.htm

Thursday, June 05, 2008

Finding BADI's & Exits

There are multiple ways of searching for BADI.

  • Finding BADI Using CL_EXITHANDLER=>GET_INSTANCE
  • Finding BADI Using SQL Trace (TCODE-ST05).
  • Finding BADI Using Repository Information System (TCODE- SE84).
  1. Go to the Transaction, for which we want to find the BADI, take the example of Transaction VD02. Click on System->Status. Double click on the program name. Once inside the program search for ‘CL_EXITHANDLER=>GET_INSTANCE’.
    Make sure the radio button “In main program” is checked. A list of all the programs with call to the BADI's will be listed.
    The export parameter ‘EXIT_NAME’ for the method GET_INSTANCE of class CL_EXITHANDLER will have the user exit assigned to it. The changing parameter ‘INSTANCE’ will have the interface assigned to it. Double click on the method to enter the source code.Definition of Instance would give you the Interface name.
  2. Start transaction ST05 (Performance Analysis).
    Set flag field "Buffer trace"
    Remark: We need to trace also the buffer calls, because BADI database tables are buffered. (Especially view V_EXT_IMP and V_EXT_ACT)
    Push the button "Activate Trace". Start transaction VA02 in a new GUI session. Go back to the Performance trace session.
    Push the button "Deactivate Trace".
    Push the button "Display Trace".
    The popup screen "Set Restrictions for Displaying Trace" appears.
    Now, filter the trace on Objects:
    V_EXT_IMP
    V_EXT_ACT

    Push button "Multiple selections" button behind field Objects
    Fill: V_EXT_IMP and V_EXT_ACT

    All the interface class names of view V_EXT_IMP start with IF_EX_. This is the standard SAP prefix for BADI class interfaces. The BADI name is after the IF_EX_.
    So the BADI name of IF_EX_CUSTOMER_ADD_DATA is CUSTOMER_ADD_DATA
  3. Go to “Maintain Transaction” (TCODE- SE93).
    Enter the Transaction VD02 for which you want to find BADI.
    Click on the Display push buttons.
    Get the Package Name. (Package VS in this case)
    Go to TCode: SE84->Enhancements->Business Add-inns->DefinitionEnter the Package Name and Execute.


    Here you get a list of all the Enhancement BADI's for the given package MB.

    Also have a look at below report which will list BADIs.

see SDN - https://www.sdn.sap.com/irj/sdn/thread?threadID=268271

Thursday, May 15, 2008

Tuesday, February 19, 2008

Move nodata character '/' to every field of a structure (sample code).

FIELD-SYMBOLS: fs TYPE ANY.

DEFINE nodata.
do.
assign component sy-index of structure &1 to fs.
if sy-subrc <> 0. exit. endif.
fs = '/'.
enddo.
END-OF-DEFINITION.

nodata: bbkpf, bbseg, bbtax, bwith, bselk, bselp.

**Another use for this type of loop:
FIELD-SYMBOLS: TYPE ANY.

DO.
ASSIGN COMPONENT sy-index OF STRUCTURE o_return TO .
IF sy-subrc <> 0. EXIT. ENDIF.
IF NOT IS INITIAL.
WRITE: / .
ENDIF.
ENDDO.

Thursday, January 03, 2008

Transport Translations

Translate report texts

SE38->goto->translation

How to transport translations:
1) Create CTS#
2) run RS_LXE_RECORD_TORDER to capture translations

See:
http://help.sap.com/saphelp_47x200/helpdata/en/3e/c06e08fe4f11d3b2a3005004ed1ff7/frameset.htm

Tuesday, December 11, 2007

Transport ABAP Query, Infoset, User Group

1. Perform these steps in the Development Client
1.1. Make a record of the User Group and Query name

1.2. Go to SAP transaction SQ02. Follow the path Environment > Transports to start the request.
1.2.1. Transport action = Export
1.2.2. Make sure to turn off the defaulted selection “Test Run”.
1.2.3. Select Transport queries
1.2.4. Import option = Replace
1.2.5. User groups = See above, normally SN-Finance
1.2.6. Queries = List the name above or a range of names if you desire to transport more than one query
1.2.7. Click the “Execute” icon to create the transport. This will give you a display of the “Export log: List of Exported objects”. Print this log as you will need the dataset name in a later step.

2. Transport new configuration to the Production Client as usual using the SE10 and STMS transactions
3. Perform these steps in the Production Client
3.1. Import the ABAP/4 Query into Production.
3.1.1. Go to SAP transaction SQ02 in production – Path = environment > transports.
3.1.2. Transport action = Import
3.1.3. Remove the default of “Test Run”
3.1.4. Allow overwriting
3.1.5. Chose Transport queries
3.1.6. Import option = Replace
3.1.7. User group = enter the name of the user group
3.1.8. Queries = enter the name of the query
3.1.9. Dataset with imports = This is the name of the “transport dataset” shown on the export log that you just printed out a few steps back.
3.1.10. Click the “execute” icon to import the query

Friday, August 03, 2007

EXEC SQL

Select data from non-SAP system DB.

1) Create connection entry in table DBCON, you will need to have a DB userid and password and the connection string.
con_name = descriptive name
dbms = mss
user_name = sql_userid
password = ****
con_env = MSSQL_SERVER=mather-mri-002 MSSQL_DBNAME=MRIAccess

ABAP:
2) Establish connection:
data: con_name like dbcon-con_name value 'MRI'.
* Connect to external DB
EXEC SQL.
CONNECT TO :con_name
ENDEXEC.
EXEC SQL.
SET CONNECTION :con_name
ENDEXEC.
IF sy-subrc <> 0.
MESSAGE e009 WITH 'Unable to connect to' con_name.
ENDIF.

3) Sample Code to Select Data:

* Drop subquery tables
EXEC SQL.
IF EXISTS(SELECT TABLE_NAME FROM MRIACCESS.INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'ZSAP_ACCTN')
DROP TABLE MRIACCESS..ZSAP_ACCTN
IF EXISTS(SELECT TABLE_NAME FROM MRIACCESS.INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'ZSAP_SAPCO')
DROP TABLE MRIACCESS..ZSAP_SAPCO
IF EXISTS(SELECT TABLE_NAME FROM MRIACCESS.INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'ZSAP_ENTIT')
DROP TABLE MRIACCESS..ZSAP_ENTIT
ENDEXEC.

* Create subquery tables
EXEC SQL.
CREATE TABLE MRIAccess..ZSAP_ACCTN ( acctn VARCHAR(9))
CREATE TABLE MRIAccess..ZSAP_SAPCO ( sapco VARCHAR(4))
CREATE TABLE MRIAccess..ZSAP_ENTIT ( entit VARCHAR(6))
ENDEXEC.
IF sy-subrc <> 0.
MESSAGE e009 WITH 'Failed to create subquery tables'.
ENDIF.
* Populate subquery tables
LOOP AT s_acctn.
EXEC SQL.
insert into MRIAccess..ZSAP_ACCTN values (:s_acctn-low)
ENDEXEC.
IF sy-subrc <> 0.
MESSAGE e009 WITH 'Failed to populate subquery tables'.
ENDIF.
ENDLOOP.
LOOP AT s_sapco.
EXEC SQL.
insert into MRIAccess..ZSAP_SAPCO values (:s_sapco-low)
ENDEXEC.
IF sy-subrc <> 0.
MESSAGE e009 WITH 'Failed to populate subquery tables'.
ENDIF.
ENDLOOP.
LOOP AT s_entit.
EXEC SQL.
insert into MRIAccess..ZSAP_ENTIT values (:s_entit-low)
ENDEXEC.
IF sy-subrc <> 0.
MESSAGE e009 WITH 'Failed to populate subquery tables'.
ENDIF.
ENDLOOP.

* Now select data from extrnal DB
* All records not extracted
EXEC SQL PERFORMING append_itab.
SELECT g.acctnum, e.saporder, e.sapco, e.EntityID, j.entrdate,
j.amt, j.descrpn, j.ref, j.Item into :itab
FROM
MRIPROD..ENTITY e
INNER JOIN MRIPROD..JOURNAL j ON j.ENTITYID = e.ENTITYID
INNER JOIN MRIPROD..GACC g ON j.ACCTNUM = g.ACCTNUM
WHERE
j.source = :p_sourc AND
g.acctnum NOT IN (select acctn from MRIAccess..zsap_acctn) AND
e.sapco NOT IN (select sapco from MRIAccess..zsap_sapco) AND
e.entityid NOT IN (select entit from MRIAccess..zsap_entit) AND
j.basis = :p_basis AND
j.dtsapul IS NULL
ENDEXEC.
IF p_update = 'X'. "Update
EXEC SQL.
UPDATE MRIPROD..JOURNAL
set dtSAPUL = :v_now
FROM
MRIPROD..ENTITY e
INNER JOIN MRIPROD..JOURNAL j ON j.ENTITYID = e.ENTITYID
INNER JOIN MRIPROD..GACC g ON j.ACCTNUM = g.ACCTNUM
WHERE
j.source = :p_sourc AND
g.acctnum NOT IN (select ACCTN from MRIACCESS..ZSAP_ACCTN) AND
e.sapco NOT IN (select sapco from MRIAccess..zsap_sapco) AND
e.entityid NOT IN (select entit from MRIAccess..zsap_entit) AND
j.basis = :p_basis AND
j.dtsapul IS NULL
ENDEXEC.
ENDIF.
*&---------------------------------------------------------------------*
*& Form append_itab
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM append_itab.
APPEND itab.
ENDFORM. " append_itab

4) Close or reset connection
** Reset to "default connection"
EXEC SQL.
SET CONNECTION DEFAULT
ENDEXEC.

Wednesday, June 27, 2007

Output update nast_protocol_update

To update the output processing log from a form processing program call function
nast_protocol_update.

Tuesday, June 19, 2007

Thursday, May 03, 2007

Email Payment Advice

Configuration:

  1. (FK02); Set Standard Comm Type = INT (SMTP), and maintain email address for Vendor
  2. (BERP); Find event 00002040, copy fm SAMPLE_PROCESS_00002040 to Z_SAMPLE_PROCESS_00002040
  3. (FIBF -> settings -> Product ->a Customer); Enter product name and description of your choice (i.e. ZMAIL) and make it active.
  4. (FIBIF -> setting ->Process fm -> ...of a Customer); Enter Process = 00002040, FM = Z_SAMPLE_PROCESS_00002040, Product = ZMAIL (name of product define by you in step 3).
  5. *This config will automatically send email to vendor provided SCOT, payment method, and payment run program variant are configured.

*SCOT: Email attachment should be in PDF but it is in OTF - remove OTF from SCOT->node EXCH->supported address type, internet->set->supported formats. Validate conversion rule config (SCOT->settings->conversion rules).

*PM should have "Always Payment Advice Notes" selected.

*F110 program variant has print Payment Advice checked.

Additional information:

Forum Email Remittance Advice
https://www.sdn.sap.com/irj/sdn/message?messageID=3056623

SAP Help:
http://help.sap.com/saphelp_47x200/helpdata/en/e7/653749d2d211d29e430000e839cd96/frameset.htm

Additional:

http://www.le.ac.uk/cc/cchelp/sap/UG3-5%20Rem%20Advice.doc

Tuesday, May 01, 2007

Internal table in ABAP memory

Remote access to internal table of other program


field-symbols: type table.
data: wa type string.
data: pointer_tab(20) type c.

pointer_tab = '(ZRICH_0001)ITAB[]'.
assign (pointer_tab) to .
loop at into wa.
write:/ wa. endloop.

Monday, April 23, 2007

Trigger inbound BAPI IDOC for message type ACC_GL_POSTING

Refer to function group EDIN.

- Use EDI_DATA_INCOMING if you want to pass a IDOC file.
- Use IDOC_INBOUND_SINGLE or IDOC_INBOUND_ASYNCHRONOUS if you want to pass IDOCs in memory.

Additional information can be found in the book "ALE, EDI, & IDoc Technologies for SAP" pages: 99, 207, 262, 498.

Wednesday, April 04, 2007

ABAP ALV Robot

This site is intended to help ABAP programmers on the creation of ALV reports by automatically generating source code using a specially designed template.
This way ALV reports get done easier and faster. Also, as they are all made from the same template, standards get honored. The generated source is not messy nor complicated. Is as readable, simple and straight-forward as any other program created by yourself!
http://www.alvrobot.com.ar/home.php

ALV Generator

Tuesday, December 05, 2006

ALV Colors

http://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=76251339


*&---------------------------------------------------------------------*
*& Report ZDEMO_ALVGRID *
*& *
*&---------------------------------------------------------------------*
*& *
*& Example of a simple ALV Grid Report *
*& ................................... *
*& *
*& The basic ALV grid, Enhanced to display each row in a different *
*& colour *
*&---------------------------------------------------------------------*

REPORT zdemo_alvgrid .

TABLES: ekko.

type-pools: slis. "ALV Declarations
*Data Declaration
*----------------
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
line_color(4) type c, "Used to store row color attributes
END OF t_ekko.

DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.

*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid.


************************************************************************
*Start-of-selection.
START-OF-SELECTION.

perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
perform display_alv_report.


*&---------------------------------------------------------------------*
*& Form BUILD_FIELDCATALOG
*&---------------------------------------------------------------------*
* Build Fieldcatalog for ALV Report
*----------------------------------------------------------------------*
form build_fieldcatalog.

* There are a number of ways to create a fieldcat.
* For the purpose of this example i will build the fieldcatalog manualy
* by populating the internal table fields individually and then
* appending the rows. This method can be the most time consuming but can
* also allow you more control of the final product.

* Beware though, you need to ensure that all fields required are
* populated. When using some of functionality available via ALV, such as
* total. You may need to provide more information than if you were
* simply displaying the result
* I.e. Field type may be required in-order for
* the 'TOTAL' function to work.

fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
* fieldcatalog-do_sum = 'X'.
* fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.

fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.

fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.

fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.

fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.

fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.

fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.

fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-datatype = 'CURR'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.

fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG

Tuesday, November 14, 2006

Sapgui progress indicator

PERFORM progress_bar USING 'Retrieving data...'(001)
sy-tabix
total_lines.


*&---------------------------------------------------------------------*
*& Form PROGRESS_BAR
*&---------------------------------------------------------------------*
FORM progress_bar USING p_value
p_tabix
p_nlines.
DATA: w_text(40),
w_percentage TYPE p,
w_percent_char(3).
w_percentage = ( p_tabix / p_nlines ) * 100.
w_percent_char = w_percentage.
SHIFT w_percent_char LEFT DELETING LEADING ' '.
CONCATENATE p_value w_percent_char '% Complete'(002) INTO w_text.
* This check needs to be in otherwise when looping around big tables
* SAP will re-display indicator too many times causing report to run
* very slow. (No need to re-display same percentage anyway)
if w_percentage gt gd_percent or p_tabix eq 1.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = w_percentage
text = w_text.
gd_percent = w_percentage.
endif.
endform. " PROGRESS_BAR

Friday, September 29, 2006

ST05 - SP vs SQL explain

Note 155413 says the following ...The output of the ST05 trace contains the runtime of theindividual SQL statements in microseconds (1.0E-6 sec). SQLstatements with longer runtimes are displayed red.- Select the slowest SQL statement and press the "Explain SQL"pushbutton.The execution plan for this SQL statement appears. The executionplan shows the indices, which the SQL Server would use at thepresent time to execute the SQL statement. This execution planmay change as soon as the contents of the database changes or anautomatic statistics update is executed.Therefore it shows the exact execution plan that is used at the time ofthe statment being run.Next onto the part about stored proceedures it states ....SAP R/3 uses Stored Procedures (SP's) for accessing the SQLServer. The SQL Server generates the execution plan during thefirst call of the SP. All additional calls use the same executionplan until the SP is re-compiled (caused, for example, by anautomatic statistics update). This improves the overallperformance of the R/3 System. However, in rare cases this canresult in very long-running SQL statements.- See Note 159171According to this part of the note the execution plan for a SQL commandis stored in cache and used again on the next time a similar commandis executed and so on.Refreshing the statistics forces the Stored Procedures to be recompiledagain and the execution plans to be updated. The following commandshould have the same effectexec sp_recompile

Thursday, August 31, 2006

Upload and Dowload to app server

Copy file between server (unix) and client (windows)

CG3Y and CG3Z for upload and download the file

Friday, July 21, 2006

Zebra - BarOne Printing ITF files

Here is some notes regarding printing labels with Zebra:This topic tells you how to use the method described under Printing Labels to create and print labels with Zebra .Procedure

1. Create the label: To design the label layout, use the design program BAR-ONE Tool for SAP R/3 label printing of the manufacturer Zebra. For more information see http://www.zebra.com. As printer, select the printer Zebra Z4000 in BAR-ONE.

2. Define the R/3 form fields: In BAR-ONE define all those fields as variable fields of type SAP variable field that will later be filled with variable data from the R/3 system. In the input field Identifier of the field attributes enter the R/3 field name to be used in SAPscript, enclosed in ampersands ("&"), for example &VBAK-KUNNR& .

3. Select fonts for the text fields: For variable and constant text fields you can use printer-internal fonts as well as TrueType fonts. For Zebra label printing, SAP has defined two different device types (see 8.). The difference lies in the character set coding for special characters (for example, German umlauts):o The device type LB_ZEB supports the character set IBM 850 of the printer-internal font "CG Triumvirate Bold Condensed". Use this device type if you want to print special characters in variable text fields in this printer-internal font. o The device type LB_ZEB2 supports the character set "Latin-1" of the TrueType fonts. Use this device type if you want to print special characters in variable text fields using TrueType fonts.

4. Insert bitmap graphics: You can include bitmap graphics (for example, company logo as *.BMP file) into the label definition. The system passes them to the print file during the download.

5. Download label definition into print file: Choose File ® Create Format for SAP R/3 to convert the printer commands into an ITF file that is suited for import into SAPscript. The Download Stored Format Wizard appears and allows you to choose between two procedures: o Download the label definition into the Zebra printer (RAM or nonvolatile memory) and create a merge file for SAPscript.o Create a file for SAPscript that contains label definition plus variable data. For performance reasons you should prefer the first method, since that print files created in R/3 to be sent to the printer have only minimal size. With the second method, even though you avoid keeping the label definition in the printer, you must pass the entire label definition to the printer for each label you print from R/3 (including graphics, fonts, and so on), which is considerably slower. BAR-ONE in both cases creates a file with the extension ".ITF".

6. Upload the print file to SAPscript: Start the SAPscript standard text editor (transaction SO10). Create a new standard text. Use Text ® Upload to load the label file; choose ITF as format. Save the file.

7. Adapt the SAPscript form: To print the label, adapt the SAPscript form you want to use for printing. Choose Utilities ® SAPscript ® Form: o The MAIN window must be as wide as possible to avoid printer commands being split up by line feeds. If the width of the main window is less than 15 cm (6 inches), enlarge it to at least this value. o You can keep all other windows unless they overlap with the MAIN window. The Zebra printer ignores any texts you may output in these windows. o Delete all windows except MAIN. If you keep any windows, they must not contain any data you want to print (you may mark texts as comments). o The MAIN window should contain only one text element which contains the newly created label file. The name of the text element depends on the R/3 application program you use. Insert the label file into this text element by copying the entire text from SO10 into the form window. o If there are any other text elements defined in MAIN that are called from within the print program, you can leave them unchanged since the printer ignores unknown commands. However, for better readability you should mark their contents as comments.o The first page of the form should point to itself as next page, since the label file in the MAIN window may be very large, especially if it includes graphics.

8. Create an output device: Define the Zebra printer as Output Device in the SAP System. The easiest way is to connect the printer to a Windows PC, install any Windows printer driver there, and start the output program SAPlpd. Then define the printer in the spool administration (transaction SPAD) using coupling type "S" or "U". As device type select LB_ZEB or LB_ZEB2 .

Wednesday, July 05, 2006

Switch from ALV Grid to ALV List at runtime

REPORT Y_RAVI_REUSE_ALV.



TYPE-POOLS : SLIS.



DATA : T_DATA TYPE TABLE OF ALV_T_T2,

T_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.



START-OF-SELECTION.



SELECT * FROM ALV_T_T2 INTO TABLE T_DATA UP TO 30 ROWS.



END-OF-SELECTION.



CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

* I_PROGRAM_NAME =

* I_INTERNAL_TABNAME =

I_STRUCTURE_NAME = 'ALV_T_T2'

* I_CLIENT_NEVER_DISPLAY = 'X'

* I_INCLNAME =

* I_BYPASSING_BUFFER =

* I_BUFFER_ACTIVE =

CHANGING

CT_FIELDCAT = T_FIELDCAT

* EXCEPTIONS

* INCONSISTENT_INTERFACE = 1

* PROGRAM_ERROR = 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.



FIELD-SYMBOLS : LIKE LINE OF T_FIELDCAT.

READ TABLE T_FIELDCAT ASSIGNING with key FIELDNAME = 'PRICE'.

IF SY-SUBRC = 0.

-DO_SUM = 'C'.

ENDIF.



DATA : WA_LAYOUT TYPE SLIS_LAYOUT_ALV.

WA_LAYOUT-allow_switch_to_list = 'X'.



DATA : WA_VARIANT TYPE DISVARIANT.

WA_VARIANT-USERNAME = SY-UNAME.

WA_VARIANT-REPORT = SY-REPID.



CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

* I_INTERFACE_CHECK = ' '

* I_BYPASSING_BUFFER = ' '

* I_BUFFER_ACTIVE = ' '

* I_CALLBACK_PROGRAM = ' '

* I_CALLBACK_PF_STATUS_SET = ' '

* I_CALLBACK_USER_COMMAND = ' '

* I_CALLBACK_TOP_OF_PAGE = ' '

* I_CALLBACK_HTML_TOP_OF_PAGE = ' '

* I_CALLBACK_HTML_END_OF_LIST = ' '

* I_STRUCTURE_NAME =

* I_BACKGROUND_ID = ' '

* I_GRID_TITLE =

* I_GRID_SETTINGS =

IS_LAYOUT = WA_LAYOUT

IT_FIELDCAT = T_FIELDCAT

* IT_EXCLUDING =

* IT_SPECIAL_GROUPS =

* IT_SORT =

* IT_FILTER =

* IS_SEL_HIDE =

* I_DEFAULT = 'X'

* I_SAVE = ' '

IS_VARIANT = WA_VARIANT

* IT_EVENTS =

* IT_EVENT_EXIT =

* IS_PRINT =

* IS_REPREP_ID =

* I_SCREEN_START_COLUMN = 0

* I_SCREEN_START_LINE = 0

* I_SCREEN_END_COLUMN = 0

* I_SCREEN_END_LINE = 0

* I_HTML_HEIGHT_TOP = 0

* I_HTML_HEIGHT_END = 0

* IT_ALV_GRAPHICS =

* IT_HYPERLINK =

* IT_ADD_FIELDCAT =

* IT_EXCEPT_QINFO =

* IR_SALV_FULLSCREEN_ADAPTER =

* IMPORTING

* E_EXIT_CAUSED_BY_CALLER =

* ES_EXIT_CAUSED_BY_USER =

TABLES

T_OUTTAB = T_DATA

* EXCEPTIONS

* PROGRAM_ERROR = 1

* OTHERS = 2

.

IF SY-SUBRC <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Wednesday, April 05, 2006

Interview Questions

Real time questions

Which client number you use for the current project?
You are running a report. It is taking long time for execution. What steps will you do to reduce the execution time.
After running a BDC program in background, next day morning when you see the results, few records are not updated(error records). What will you do then?
You are given functional specs for a BDC program and you need to decide whether to write a method call transaction or a session. How u will decide?
What is the difference between report and script?
what are the differences between scripts & smart forms?
what are enhancements?
what are user-exits?
what is badi?
what is the difference between user-exit & BADIs?
what is the difference between user-exit & customer-exit?
how do you get functional specs when you are assigned some object? (specs through email..??)
How do you write technical specs?
How do you write UTP?(unit test plan)


ABAP FAQ (Technical)
DATA DICTIONARY
What is data Dictionary ?
What is the difference between open sql & native sql ?
Difference between Pooled, cluster & transparent tables?
What is Primary key, foreign key ? what is primary index? secondary index?
how many indexes can be created for a table?
what is a value table?
what are the components of a table?
what is a domain?
what is a data element?
what is data class?
can you create a table with out a data element?
can you create a field with out a data element?
What approach you prefer for creating a table?
Give few names of cluster tables in sap?
Give few names of pooled tables in sap?
give few names of transparent tables?
what is a buffer and how many types?
what is table maintenance generator and how to create that? What is the transaction code?
How to add new fields to a standard sap table ?
How many types of table joins are there?
difference between inner join & outer join?
Difference between "select * from mara" and "select single * from mara"?
what is a match code ? Lock objects ?
what are views?
what are logical tables/database?
what is the difference bet'n table and a structure?

REPORTS
what is a report?
what are types of reports?
difference bet'n simple and interactive reports?
what are the events in interactive reports?
what is the first event that will be triggered in a report?
what is the use of Initialization event? give one example.
what is the use of start-of-selection event?
what is the difference betn end-of-page and end-of-selection?
if you write a write statement after end-of-selection, will that be triggered?
how to create a button in selection screen?
how to add a gui status in a selection screen?
what is at-line-selection event?
How many secondary lists can be created in an interactive report?
how to create a check box/option button in a list?
can you call a bdc program from a report? how?
can you call a transaction from a report? how?
what are ALV reports? how they are different from normal reports?
what are the main events that are used in an ALV report?
what is the use of SLIS type pool in alv reports?
difference betn top-of-page and top-of-page during at-line-selection?
in an interactive report, after going to 5th list, can you come back to 2nd list? how?

Internal Tables
what is an internal table?
how many type of internal tables are there?
what is the difference between hashed & sorted internal tables?
what is the difference between standard and sorted internal tables? (in performance wise)
Difference between internal table and a dictionary table?
can you create an internal table dynamically?(at run time)
what is the use of select for all entries in an internal table?
when you are using 2 internal table in program, you have decided to use for all entries statement to retrieve data but unfortunately there are no records in the first internal table. What will be the result? (2nd internal table contains records).
in a loop of an internal table, what is the use of at first & at last statements?
What is the use of at new statement?
what is the difference between at first & at new statements?
what is a binary search ? and how it is useful in a sorted internal table?
when do you need to create an internal table with header line ?and with out a header line?
what does it mean occurs 0 while creating an internal table?
what will happen if you don't give occurs clause while creating an internal table?
what is the difference between clear, delete & refresh with respect to an internal table?

BDC & LSMW
What is BDC ?
What is call transaction method ? what is the syntax/procedure?
What is session method and what is the syntax/procedure?
Difference between call transaction & session method?
which of these methods can be best used in background process?
What is direct input method?
How LSMW is advantageous than normal BDC?
what are the steps in lsmw?
IN LSMW can you use BAPI, ?
Can you call a bdc from a report program?
what is the difference between synchronus & asynchronus methods?
call transaction uses synchronus or synchronus method?
session method uses synchronus or synchronus method?
What is bapi?
how bapi is different from call transaction/session?
what r the advantages of bapi?
for uploading master data(ex:customer data) into sap, which methods you prefer? call transaction/session/lsmw/bapi? why?
tell any 2 standard bapi function modules used for uploading sales order data?

Performance Tuning
What is performance tuning?
What are steps you follow to improve the performance of a report ?
what is the role of secondary index in performance?
what is the role of ST05 in performance tuning?
what is the role of extended syntax check in performance tuning?
will join conditions in sql queries affect perfomance? how?
will sorted internal tables help in performance?
will where conditions in a sql query help improve performance?
does select single *.. / select * .. affect performance ? how?

Sap Scripts & Smart forms
What is the difference between a script & a report ?
What are the components/elements in sap script ?
Can you create a script with out a main window ?
How many main windows can be created for a script ?
How can we use tables in sap scripts?
How to print a logo in a sap script?
When we need to modify standard scripts(eg:medruck) given by sap?
What is the use of transaction code NACE in sap scripts?
what is the table name that will contain all the script form names and print program names?
Can you assign your own form to a standard print program? how?
What is the use of PROTECT & ENDPROTECT?
How to add extra functionality to a standard print program with out touching the print program?
what is sub routine pool in sap script? when it is used?
How to read text in sapscripts?
What is the transaction code for logo uploading?
what is the difference between paragraph & character format?
How to use a sapscript for multiple languages ? (english,germany etc)
How to download/upload sapscripts from & to your PC ?
What is the difference between scripts & smart forms?
What is the standard program used for uploading the logo to script?
How can you send forms from one client to other?
what does open_form, write_form, close_form do?
How to convert a sapscript to smart form?
How to send a smartform result through mail?
how to select desired paper size in sapscript?
tableWorkaround(3)
Updating more faq every day...plz revisit..