Quantcast
Channel: SCN : Document List - ABAP Development
Viewing all 935 articles
Browse latest View live

Single Euro Payments Area (SEPA) Implementation of Direct Debit-Technical Design

$
0
0

Single Euro Payments Area (SEPA) Implementation of DD(Direct Debit)(Technical)

Sep, 2013

Introduction

SEPA stands for ‘Single Euro Payment Area’. It’s a system that is designed to create financial efficiency for countries using the currency Euro by providing a unified system in which to perform financial transactions. The SEPA seeks to create a better system for credit transfers, an improved debit system and a cheaper way for individuals and firms to make transactions within member countries or regions. Implementation of SEPA makes the customers life easier. Irrespective of the national area customers will be able to use the same card for all euro payments and also they need only one bank account in euro area.

Introduction to SEPA process:

The below mentioned should be done for Implementation of SEPA business in any SAP system:

1.    SEPA_Activation_Mandate_Management

Following are the activities which are to be done as part of this:

i.        SEPA mandate management has to be activated for the usage with SDD CORE and SDD B2B from FI-AR payment processing.  Apart from activating the SEPA Mandate management we need to maintain the SEPA Mandate management modifiable fields.

 

Below is the path for activating the SEPA Mandate Management and maintain the modifiable fields.

IMG -> Financial Accounting -> Accounts Receivable and Account Payable -> Business Transactions -> Incoming Payments -> Management of SEPA Mandates -> General Settings.

screen1.png

IMG -> Financial Accounting -> Accounts Receivable and Account Payable -> Business Transactions -> Incoming Payments -> Management of SEPA Mandates -> Define Modifiable Fields

screen2.png                                                                                                                                                                  

ii.        Creation of new DMEE Payment Format tree for SEPA credit transfer and SEPA direct debit.

·         SEPA_CT and SEPA_DD are the DMEE formats provided by SAP.

·         As we will be dealing with multiple countries it is always better to copy the DMEE formats and create new ones. If there is any custom requirement for any country create a user exit and assign to the field that needs to be changed dynamically.

2.  Pre Notification with payment run  :

With a direct debit pre-notification, Markets can inform a payer in writing in advance of the debiting of his account. To do this, one has to schedule a run for the creation of direct debit pre-notifications before the payment run, meaning before clearing the open items and creation of payment media. These correspond in structure to the payment advice notes, and therefore contain details of the run date, the amount to be collected, mandate ID, Unified Creditor Identifier etc.

Following are the SAP notes to be implemented for SEPA Pre-notification.

SAP Note

Description

1679118

F110:  Custom Selection for Batch Input

1760564

F110S:  Selection Check for Customers and Vendors

1770425

F111/SEPA: Mandate rejected as invalid after change

1771071

FBCJ : Reversal possible despite cleared item

1776076

F110/F111 : BADI for SEPA Mandate usage

1780941

SEPA: Direct debit Pre-Notification

1792691

Valid SEPA mandate is not found in the system during payment proposal processing

 

As part of the Note implementation 1780941, we need to implement manual steps given below for importing the Standard SAP Form.

·    SAP has provided text file by using this file we need to import the object F110_DD_PRENOTIF into SAP by executing program RSTXCRP.  This is standard SAP form which will be used for sending PreNotifications.

·    SAP has provided XML file by using this file we need to import the object F110_DD_PRENOTIF into SAP using SFP transaction code. Once it is uploaded, activate the form.

Once all the relevant OSS Notes are implemented for SEPA Direct debit pre-notification, we will get option of checkbox for Pre-notification in F110 transaction and also pre-notification relevant standard program RFFOAVIS_DD_PRENOTIF and script form (F110_DD_PRENOTIF) available in the system.

screen3.png

The above check box is checked if we need to do SEPA prenotification.

screen4.png

 

RFFOAVIS_DD_PRENOTIF: This is the payment advice print program that is used to print the pre-notifications the pre-notification

F110_DD_PRENOTIF: This is the standard SAP script which is used to send the pre-notifications.

scrren61.png

          Based on the user requirement, the form name can be changed

·      The new "direct debit pre-notification" object is visible in the payment run (F110), in the document display (FB03), in the line item display (FBL5N) and in mandate display (FSEPA_M4). It can be deleted again if the direct debit pre-notification customer objects to it (for example, because the customer pays the bill himself). Otherwise, the posting run and the payment medium creation are performed after the end of the specified wait time based on the direct debit pre-notifications.

3.  Creation of SEPA Mandates for payment transactions :

·       Before doing any transaction for any SEPA customer we need to have a mandate create for the Customer.

·       Before creating a mandate the Customer Should have IBAN number.

·       Transactions used :

Creation

FSEPA_M1

Change

FSEPA_M2

Display

FSEPA_M3,FSEPA_M4

NOTE: Mandates can also be created from the payment tab of the Customer Master XD01, FD01, XD02,FD02.

NOTE: Mandate Number can be either External or Internal Number.

·       To make our work easier technically we can use the below procedure using the below BAPI's:

·       The table that is Master for all the SEPA mandates is SEPA_MANDATE.

·       SEPA_MANDATE: This is the Standard Smart form used to print the mandate details for any customer.

·       Assume a file with the Customer and mandate Information is available

Ø  Check if the customer is created by checking in the KNB1 table.

Ø  If the Customer is present then check if the Customer has IBAN and BIC number.

Ø  Check if the mandate is not created for Customer with the mandate number using the BAPI SEPA_MANDATES_API_GET.

Ø  For the BAPI SEPA_MANDATES_API_GET pass the customer number in the importing parameter to check if there is any mandate information present for the Customer SEPA_GET_CRITERIA_MANDATE-snd_id = Customer Number .

screen6.png

Ø  ET_MANDATES contains the mandate information that is fetched from BAPI based on the Customer Number.

scrren71.png

NOTE :   SEPA_MANDATES_API_GET FM cannot be used for multiple mandate scenario. We can write take MGUID from REGUH table and go to SEPA_MANDATE table and get the IBAN number and mandate number.

 

Three BAPI'S are majorly used to Creation and updating of the mandate details of the Customer.

To fetch the Mandate information for a particular Customer from the table SEPA_MANDATE table

SEPA_MANDATES_API_GET

Create the Mandate for a Customer

BAPI_SEPA_MANDATE_CREATE1

Modification of Mandate details for a customer

BAPI_SEPA_MANDATE_CHANGE1

 

·       Mandate Creation:

Ø Use the BAPI BAPI_SEPA_MANDATE_CREATE1 to create the mandate .

Ø BAPI_S_SEPA_MANDATE_COMMON structure which is importing parameter to the above mentioned BAPI has to be filled with the mandate information .This contains both the Sender (Customer Details ) and  receiver details (Company code data ).

screen-8.png

Ø Then collect all the address information either from the file provided or from the customer master data and fill the Sender information in the structure BAPI_S_SEPA_MANDATE_COMMON.

Ø Then based on the company code fetch the address details of the Company code and fill the Receiver information in the structure BAPI_S_SEPA_MANDATE_COMMON.

Ø ES_MANDATE_CREATED exporting parameter in the above BAPI gives a success message if the mandates are correctly created for the customer.

Ø  Error handling can be done with the return exporting parameter.

screen9.png

 

·       If the mandate already exists then check if there is any change in the mandate information.

Mandate modification:

Ø  Use the BAPI BAPI_SEPA_MANDATE_CHANGE1 to change the already existing mandate.

Ø  BAPI_S_SEPA_MANDATE_CHANGE structure which is importing parameter to the above mentioned BAPI has to be filled with the mandate information .This contains both the Sender (Customer Details) and  receiver details (Company code data ).

screen9.png

Ø  In case ofupdation is failed it can handled by  return parameter of the BAPI

screen-10.png

  Display of Mandates :

Ø  The created mandates can be checked by FSEPA_M3 Give the Mandate number or Customer Number and check for the Mandate information.

screen11.png

On Click on Enter the below Screen appears which displays all the information.

screen12.png

 

Ø We can also check the Mandate information through Customer master display  using transaction fd02,xd02,xd03,fd03.screen13.png

Click on the Tab to check and create the mandate Details from Customer master

Display the List of Mandates:

Ø  Use the transaction FSEPA_M4 to display a list for customers for a particular company code.

screen14.png

Ø  Mention the company code in the below transaction and then execute all the mandates present for the company code will be displayed.

Ø  A list of mandates will be displayed as shown in the below screen shot.

screen15.png

The above lights depicts different status of the mandates below are the differnent status of mandates.

0         

Entered

1

Active

2

To Be Confirmed

3

Locked

4

Canceled

5

Obsolete

6

CompletedCompleted

Ø  If we need to print a particular mandate information then select the Print mandate button on the top right corner of the list .

screen16.png

Ø  For this SAP has provided a smartform SEPA_MANDATE.This can be customized at central level and the thus the mandate can be created and mandate information can be printed.

screen17.png

All the inforamtion related to the mandate is available in the table SEPA_MANDATE.


How to call a dll file of windows using SAP ABAP

$
0
0

In ABAP language exists many forms to connect and i want explain how to call dll files for Windows

Below follow step by step to construction:

 

1 – Create the dll files. In my example i am using the visual basic language, but you can use another language of programmer (ex.: Delphi, C# etc)

 

 

VERSION 1.0 CLASS

 

BEGIN

 

  MultiUse = -1  'True

 

  Persistable = 0  'NotPersistable

 

  DataBindingBehavior = 0  'vbNone

 

  DataSourceBehavior  = 0  'vbNone

 

  MTSTransactionMode  = 0  'NotAnMTSObject

 

END

 

Attribute VB_Name = "DLL_VB"

 

Attribute VB_GlobalNameSpace = False

 

Attribute VB_Creatable = True

 

Attribute VB_PredeclaredId = False

 

Attribute VB_Exposed = True

 

' Declaration of variable return

 

Private s_retorno As String

 

Public Property Get retorno() As String

 

      retorno = "retorno: " & s_retorno

 

End Property

 

' Function that receives the command and variable playing in s_retorno

 

Public Function envia_comando(ByRef s_comando As String)

 

    s_retorno = s_comando

 

End Function

 


1.1 - Afterbuilding the DLLyou need to registerin windows using the command:

 

     regsvr32 <file name >.dll

 

  After this you are should look the pop-up with message:


 

2 - Execute the program regedit.exe in Windows System and find the name of DLL file


 

You need find two values in regedit.exe.

 

CLsid : {2EC47E73-2E05-45BA-AC8B-CD7E798D4034}

 

 

TypeLib: {4F4B5B12-5F45-43DB-A06E-2065395F9866}

 

 

3 - This values do you must put in transaction SOLE

 

 

4 - Below the example in SAP ABAP that call dll file in Windows.

 

This example: send a string and return another string using the file dll

 

*"----------------------------------------------------------------------

*"*"Interface local:

*"  IMPORTING

*" VALUE(I_COMANDO) TYPE  CHAR20 OPTIONAL

*"  EXPORTING

*" VALUE(E_RETORNO) TYPE  CHAR20

*"  EXCEPTIONS

*" CREATE_OBJECT_ERROR

*" GET_PROPR_ERROR

*"      CALL_ERROR

*" FREE_OBJ_ERROR

*"----------------------------------------------------------------------

 

* Includes

  INCLUDE ole2incl.

 

* Global Variables

  DATA: obj_vb TYPE ole2_object,

        vg_comando(20) TYPE c,

        vg_retorno(20) TYPE c.

 

* sends the command to the dll

  vg_comando = I_COMANDO.

 

* Creating the object to use the DLL

  CREATE OBJECT obj_vb 'TESTDLL'.

  IF sy-subrc NE 0.

    RAISE create_object_error.

  ENDIF.

 

* Sending the command to the dll

  CALL METHOD OF obj_vb 'envia_comando' EXPORTING #1 = vg_comando.

 

* Receiving command of dll

 

  get property of obj_vb 'RETORNO' = vg_retorno.

  IF sy-subrc NE 0.

    RAISE get_propr_error.

  ELSE.

    E_RETORNO = vg_retorno.

  ENDIF.

 

* Deallocates the object memory

  FREE OBJECT obj_vb.

  IF sy-subrc NE 0.

    RAISE free_obj_error.

  ENDIF.

 

ENDFUNCTION.

 

 

I have helped, any questions please send a message.

 

Regards

 

Marcelo Macedo

Sales Order number update in the standard logs for FSCM Credit Checks

$
0
0

This document explains how to update the Sales Order number to the logs created for FSCM credit management credit checks during SO Creation.

 

Requirement:

As a part of FSCM Credit Management, Logs will be registered in the database for the credit checking steps performed. These logs should be created for failed credit checks triggered for business partner and the sales order number should be added to these logs.

 

Prerequisites:

  1. FSCM Credit Management setup should be in place
  2. Credit Checking steps should be implemented
  3. Business Partner should be assigned to the Check Rule defined for credit checks to trigger during the SO creation under Credit Profile tab of transaction UKM_BP.

 

Functionality:

At the time of creation of Sales Order, basis the FSCM Credit Management setup and credit checking steps configurations, logs will be created for credit checks performed. (We can perform any number of credit checks based on the requirement).

Credit checks are displayed in the popup with the details of failed checks.

Sales Order will not be generated at this point of time, but logs will be posted to database. Once we continue, then only Sales Order will be created.

 

These logs can be viewed though transaction code “UKM_LOGS_DISPLAY”.

 

Challenge:

Since the Credit checking process is the intermediate step, it is not possible for the user to find the Sales Order for which credit checks are failed.

 

Solution:

For this we have implemented one implicit enhancements and one user exit to enhance the standard functionality.

  1. Implicit Enhancement in the method CHECK_ACCOUNT of class “CL_UKM_CREDIT_CHECKER”.

Pseudo Code:

DATA: lv_mem_id TYPE string.

 

                CONCATENATE is_item-partner      "Business Partner

                                                is_item-credit_sgmnt "Credit Segment

                                                is_item-iguid        "GUID

                                                l_log_handle         "Log Handle

                                                INTO lv_mem_id SEPARATED BY ','.

                EXPORT lv_mem_id = lv_mem_id TO MEMORY ID 'ZLOGID'.

  1. Implement User Exit “USEREXIT_SAVE_DOCUMENT” of Include MV45AFZZ with below Pseudo code.

 

DATA: lv_mem_id      TYPE string,

            lv_dummy       TYPE string,

            lv_partner     TYPE bu_partner,

            lv_credit_sgmt TYPE ukm_credit_sgmnt,

            lv_log_ref TYPE ukm_item_guid,

            lv_log_handle  TYPE balloghndl.

 

  CONSTANTS: c_va01  TYPE sytcode VALUE 'VA01',

                       c_va02  TYPE sytcode VALUE 'VA02'.

 

  IMPORT lv_mem_id FROM MEMORY ID 'ZLOGID'.

  FREE MEMORY ID 'ZLOGID'.

 

  IF ( sy-tcode = c_va01 OR sy-tcode = c_va02 ).

    IF lv_mem_id IS NOT INITIAL.

      SPLIT lv_mem_id at ','

         INTO lv_partner

                   lv_credit_sgmt

                   lv_log_ref

                   lv_log_handle.

 

      "Add SO# to the Credit Checking log

      MESSAGE S000(ukm_check) WITH 'Sales Order Number: ' VBAK-VBELN

                              INTO lv_dummy.

 

      "Update the log for partner, segment and log reference imported

      CALL METHOD cl_ukm_log_gate=>add_message_credit_check

        EXPORTING

          i_partner           = lv_partner

          i_credit_sgmnt  = lv_credit_sgmt

          i_log_reference = lv_log_ref

        CHANGING

          c_log_handle    = lv_log_handle.

 

      "Save the Logs

cl_ukm_log_gate=>save_logs( ).

 

    ENDIF. "IF lv_mem_id IS NOT INITIAL.

  ENDIF. "IF ( sy-tcode = 'VA01' OR sy-tcode = 'VA02' )


Result:

Uploading and Downloading Files from SAP to PC and Vice Versa

$
0
0


Hi,

 

Please find the code for Downloading/Uploading/Deleting the files from Application Server to presentation Server and vice versa.

 

   *&---------------------------------------------------------------------*
*& Report  Z_UPLOAD_APPSERV
*&
*&---------------------------------------------------------------------*
*& Cust prog to upload files from folder in Presentation server to
*  Applic server
*&---------------------------------------------------------------------*

REPORT  z_upload_appserv.


DATA: it_pcfile TYPE filetable,
      wa_pcfile TYPE file_table.

DATA: it_appfile TYPE TABLE OF ddshretval,
      wa_appfile TYPE ddshretval.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: p_upl  RADIOBUTTON GROUP g1 USER-COMMAND flag DEFAULT 'X' MODIF ID mf1,
            p_down RADIOBUTTON GROUP g1 MODIF ID mf1,
            p_del  RADIOBUTTON GROUP g1 MODIF ID mf1.

SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS p_chk1 AS CHECKBOX MODIF ID mf5.
PARAMETERS p_pres1 RADIOBUTTON GROUP g2 USER-COMMAND flag1 DEFAULT 'X' MODIF ID mf2 .
SELECTION-SCREEN COMMENT 7(25) text-002 FOR FIELD p_pres1 MODIF ID mf2.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS p_chk2 AS CHECKBOX MODIF ID mf5.
PARAMETERS p_appl1 RADIOBUTTON GROUP g2 MODIF ID mf2.
SELECTION-SCREEN COMMENT 7(25) text-003 FOR FIELD p_appl1 MODIF ID mf2.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(30) text-008 MODIF ID mf6.
PARAMETERS p_dir TYPE localfile MODIF ID mf6."#EC *
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(30) text-005 MODIF ID mf3.
PARAMETERS p_pres TYPE localfile MODIF ID mf3.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(30) text-006 MODIF ID mf4.
PARAMETERS p_appl TYPE txt1024 MODIF ID mf4 .
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(30) text-007 MODIF ID mf7.
PARAMETERS p_file TYPE txt1024 MODIF ID mf7."#EC *
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
    IF p_upl  = 'X'.
      IF screen-group1 = 'MF2' OR
         screen-group1 = 'MF5' OR
         screen-group1 = 'MF6' OR
         screen-group1 = 'MF7'.
        screen-active  = 0.
        MODIFY SCREEN.
      ENDIF.
    ELSEIF p_down = 'X'.
      IF screen-group1 = 'MF2' OR
         screen-group1 = 'MF3' OR
         screen-group1 = 'MF5'.
        screen-active  = 0.
        MODIFY SCREEN.
      ENDIF.
    ELSEIF p_del = 'X'.
      IF p_pres1 = 'X'.
        IF screen-group1 = 'MF4' OR
           screen-group1 = 'MF5' OR
           screen-group1 = 'MF6' OR
           screen-group1 = 'MF7'.
          screen-active  = 0.
          MODIFY SCREEN.
        ENDIF.
      ELSEIF p_appl1 = 'X'.
        IF screen-group1 = 'MF3' OR
           screen-group1 = 'MF5' OR
           screen-group1 = 'MF6'.
          screen-active  = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDLOOP.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_dir.
  PERFORM select_dir_from_pc.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_pres.
  PERFORM select_files_from_pc.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
  PERFORM select_files_from_appl.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_appl.
  PERFORM select_direc_from_appl.

START-OF-SELECTION.

  IF p_upl = 'X'.
    PERFORM upload_files.
  ELSEIF p_down = 'X'.
    PERFORM download_files.
  ELSEIF p_del = 'X'.
    IF p_pres1 = 'X'.
      PERFORM delete_pc_files.
    ELSEIF p_appl1 = 'X'.
      PERFORM delete_app_files.
    ENDIF.
  ENDIF.

END-OF-SELECTION.

*&---------------------------------------------------------------------*
*&      Form  select_dir_from_pc
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM select_dir_from_pc.

  DATA: lv_dir TYPE string.

  CALL METHOD cl_gui_frontend_services=>directory_browse
    CHANGING
      selected_folder      = lv_dir
    EXCEPTIONS
      cntl_error           = 1
      error_no_gui         = 2
      not_supported_by_gui = 3
      OTHERS               = 4.
  IF sy-subrc = 0.
    p_dir = lv_dir.
  ENDIF.

ENDFORM.                    "select_dir_from_pc

*&---------------------------------------------------------------------*
*&      Form  select_files_from_pc
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM select_files_from_pc.

  DATA lv_rc TYPE i.

  CALL METHOD cl_gui_frontend_services=>file_open_dialog
    EXPORTING
*      file_filter             = '*.txt|*.TXT'
      multiselection          = 'X'
    CHANGING
      file_table              = it_pcfile
      rc                      = lv_rc
    EXCEPTIONS
      file_open_dialog_failed = 1
      cntl_error              = 2
      error_no_gui            = 3
      not_supported_by_gui    = 4
      OTHERS                  = 5.
  IF sy-subrc = 0.
    SORT it_pcfile BY filename.
  ENDIF.

ENDFORM.                    "select_files_from_pc

*&---------------------------------------------------------------------*
*&      Form  select_files_from_appl
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM select_files_from_appl.

  DATA: lt_dynp TYPE TABLE OF dynpread,
        lt_pcfile TYPE TABLE OF eps2fili,
        ls_dynp TYPE dynpread,
        "ls_pcfile TYPE eps2fili,
        lv_dir  TYPE eps2filnam.

  ls_dynp-fieldname = 'P_APPL'.
  APPEND ls_dynp TO lt_dynp.
** Get Value of P_APPL
  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      dyname               = sy-repid
      dynumb               = sy-dynnr
    TABLES
      dynpfields           = lt_dynp
    EXCEPTIONS
      invalid_abapworkarea = 1
      invalid_dynprofield  = 2
      invalid_dynproname   = 3
      invalid_dynpronummer = 4
      invalid_request      = 5
      no_fielddescription  = 6
      invalid_parameter    = 7
      undefind_error       = 8
      double_conversion    = 9
      stepl_not_found      = 10
      OTHERS               = 11.
  IF sy-subrc = 0.
    READ TABLE lt_dynp INTO ls_dynp INDEX 1.
    IF sy-subrc IS INITIAL.
      lv_dir = ls_dynp-fieldvalue.
    ENDIF.
** Get List of Files in the selected directory
    IF lv_dir IS NOT INITIAL.
      CALL FUNCTION 'EPS2_GET_DIRECTORY_LISTING'
        EXPORTING
          iv_dir_name            = lv_dir
        TABLES
          dir_list               = lt_pcfile
        EXCEPTIONS
          invalid_eps_subdir     = 1
          sapgparam_failed       = 2
          build_directory_failed = 3
          no_authorization       = 4
          read_directory_failed  = 5
          too_many_read_errors   = 6
          empty_directory_list   = 7
          OTHERS                 = 8.
      IF sy-subrc <> 0.
        MESSAGE text-015 TYPE 'I'.
      ELSE.
        CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
          EXPORTING
            retfield        = 'NAME'
            dynpprog        = sy-repid
            dynpnr          = sy-dynnr
            value_org       = 'S'
            multiple_choice = 'X'
          TABLES
            value_tab       = lt_pcfile
            return_tab      = it_appfile
          EXCEPTIONS
            parameter_error = 1
            no_values_found = 2
            OTHERS          = 3.
        IF sy-subrc = 0.
          SORT it_appfile.
        ENDIF.
      ENDIF.
    ENDIF.

  ENDIF.

ENDFORM.                    "select_files_from_appl

*&---------------------------------------------------------------------*
*&      Form  upload_files
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM upload_files.

  DATA: lv_file   TYPE rcgfiletr-ftappl,
        lt_match  TYPE match_result_tab,
        ls_match  TYPE match_result,
        lv_count  TYPE i,
        lv_len    TYPE i,
        lv_offset TYPE i,
        lv_chars  TYPE i,
        lv_temp   TYPE char256,
        lt_data   TYPE TABLE OF text4096,
        ls_data   TYPE text4096,
        lv_fname  TYPE string.

  LOOP AT it_pcfile INTO wa_pcfile.

    CLEAR: lv_file, lv_temp, lv_len, lv_count, lv_offset, lv_chars.

    FIND ALL OCCURRENCES OF '\' IN wa_pcfile-filename RESULTS lt_match.
    DESCRIBE TABLE lt_match LINES lv_count.
    READ TABLE lt_match INTO ls_match INDEX lv_count.
    IF sy-subrc IS INITIAL.
      lv_len = STRLEN( wa_pcfile-filename ).
      lv_offset = ls_match-offset + 1.
      lv_chars = lv_len - lv_offset.
      lv_temp = wa_pcfile-filename+lv_offset(lv_chars).
    ENDIF.

    CONCATENATE p_appl '/' lv_temp INTO lv_file.

    CLEAR lv_fname.
    REFRESH lt_data.
    lv_fname = wa_pcfile-filename.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                = lv_fname
        filetype                = 'ASC'
      TABLES
        data_tab                = lt_data
      EXCEPTIONS
        file_open_error         = 1
        file_read_error         = 2
        no_batch                = 3
        gui_refuse_filetransfer = 4
        invalid_type            = 5
        no_authority            = 6
        unknown_error           = 7
        bad_data_format         = 8
        header_not_allowed      = 9
        separator_not_allowed   = 10
        header_too_long         = 11
        unknown_dp_error        = 12
        access_denied           = 13
        dp_out_of_memory        = 14
        disk_full               = 15
        dp_timeout              = 16
        OTHERS                  = 17.
    IF sy-subrc = 0.
      OPEN DATASET lv_file IN TEXT MODE FOR OUTPUT ENCODING DEFAULT.
      IF sy-subrc IS INITIAL.
        LOOP AT lt_data INTO ls_data.
          TRANSFER ls_data TO lv_file.
        ENDLOOP.
        CLOSE DATASET lv_file.
        WRITE: / text-009, wa_pcfile-filename.
      ELSE.
        WRITE: / text-010, wa_pcfile-filename.
      ENDIF.
    ELSE.
      WRITE: / text-010, wa_pcfile-filename.
    ENDIF.
  ENDLOOP.

ENDFORM.                    "upload_files

*&---------------------------------------------------------------------*
*&      Form  download_files
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM download_files.

  DATA: lv_pcfile TYPE string,
        lv_apfile TYPE rcgfiletr-ftappl,
        lv_rvstri TYPE rcgfiletr-ftappl,
        lt_data   TYPE TABLE OF text4096,
        ls_data   TYPE text4096.

  LOOP AT it_appfile INTO wa_appfile.

    CLEAR: lv_pcfile, lv_apfile.

    CONCATENATE: p_dir '\'  wa_appfile-fieldval INTO lv_pcfile,
                 p_appl '/' wa_appfile-fieldval INTO lv_apfile.

    REFRESH lt_data.
    CALL FUNCTION 'STRING_REVERSE'
      EXPORTING
        string    = lv_apfile
        lang      = sy-langu
      IMPORTING
        rstring   = lv_rvstri
      EXCEPTIONS
        too_small = 1
        OTHERS    = 2.
    IF    ( sy-subrc = 0
      AND ( lv_rvstri+0(3) = 'FDP'
      OR    lv_rvstri+0(3) = 'fdp') ) .

      sy-cprog = 'SAPLC13G'."#EC WRITE_OK
      CALL FUNCTION 'C13Z_FILE_DOWNLOAD_BINARY'
        EXPORTING
          i_file_front_end   = lv_pcfile
          i_file_appl        = lv_apfile
          i_file_overwrite   = 'X'
        EXCEPTIONS
          fe_file_open_error = 1
          fe_file_exists     = 2
          ap_no_authority    = 4.
    ELSEif ( sy-subrc = 0 ).
      OPEN
       DATASET lv_apfile
            IN TEXT MODE
           FOR INPUT
      ENCODING DEFAULT.
      IF sy-subrc = 0.
        DO.
          READ DATASET lv_apfile INTO ls_data.
          IF sy-subrc IS INITIAL.
            APPEND ls_data TO lt_data.
          ELSE.
            EXIT.
          ENDIF.
        ENDDO.
        CLOSE DATASET lv_apfile.
      ENDIF.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = lv_pcfile
          append                  = 'X'
        TABLES
          data_tab                = lt_data
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6
          header_not_allowed      = 7
          separator_not_allowed   = 8
          filesize_not_allowed    = 9
          header_too_long         = 10
          dp_error_create         = 11
          dp_error_send           = 12
          dp_error_write          = 13
          unknown_dp_error        = 14
          access_denied           = 15
          dp_out_of_memory        = 16
          disk_full               = 17
          dp_timeout              = 18
          file_not_found          = 19
          dataprovider_exception  = 20
          control_flush_error     = 21
          OTHERS                  = 22.
    ENDIF.

    IF sy-subrc = 0.
      WRITE: / text-011, lv_pcfile.
    ELSE.
      WRITE: / text-012, lv_apfile.
    ENDIF.

  ENDLOOP.

ENDFORM.                    "download_files

*&---------------------------------------------------------------------*
*&      Form  delete_pc_files
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM delete_pc_files.

  DATA: lv_pcfile TYPE string,
        lv_rc     TYPE i.

  LOOP AT it_pcfile INTO wa_pcfile.

    CLEAR lv_pcfile.
    lv_pcfile = wa_pcfile-filename.

    CALL METHOD cl_gui_frontend_services=>file_delete
      EXPORTING
        filename             = lv_pcfile
      CHANGING
        rc                   = lv_rc
      EXCEPTIONS
        file_delete_failed   = 1
        cntl_error           = 2
        error_no_gui         = 3
        file_not_found       = 4
        access_denied        = 5
        unknown_error        = 6
        not_supported_by_gui = 7
        wrong_parameter      = 8
        OTHERS               = 9.
    IF sy-subrc = 0.
      WRITE: / text-013, lv_pcfile.
    ELSE.
      WRITE: / text-014, lv_pcfile.
    ENDIF.

  ENDLOOP.

ENDFORM.                    "delete_pc_files

*&---------------------------------------------------------------------*
*&      Form  delete_app_files
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM delete_app_files.

  DATA lv_apfile TYPE rcgfiletr-ftappl.

  LOOP AT it_appfile INTO wa_appfile.
    CLEAR: lv_apfile.
    CONCATENATE p_appl '/' wa_appfile-fieldval INTO lv_apfile.
    DELETE DATASET lv_apfile.
    IF sy-subrc IS INITIAL.
      WRITE: / text-013, lv_apfile.
    ELSE.
      WRITE: / text-014, lv_apfile.
    ENDIF.
  ENDLOOP.

ENDFORM.                    "delete_app_files
*&---------------------------------------------------------------------*
*&      Form  SELECT_DIREC_FROM_APPL
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM select_direc_from_appl .

  TYPES : BEGIN OF ty_direc,
          dirnme TYPE dirname,
          END OF ty_direc .

  DATA : lv_path TYPE TABLE OF ddshretval,
         lt_dir TYPE TABLE OF ty_direc .

  DATA : wa_path TYPE ddshretval.

  "selecting the list of custom directory in application server
  SELECT dirname
    FROM user_dir
    INTO
   TABLE lt_dir .

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'  "Fm to display the IT as Serach help
    EXPORTING
*   DDIC_STRUCTURE         = ' '
      retfield             = 'DIRNME'
      dynpprog             = sy-repid
      dynpnr               = sy-dynnr
      value_org            = 'S'
    TABLES
      value_tab            = lt_dir
   return_tab              = lv_path
   EXCEPTIONS
     parameter_error        = 1
     no_values_found        = 2
     OTHERS                 = 3.

  IF sy-subrc = 0 AND lv_path IS NOT INITIAL .

    READ
    TABLE lv_path
    INTO  wa_path
    INDEX 1.

    p_appl = wa_path-fieldval.

  ENDIF.

ENDFORM.                    " SELECT_DIREC_FROM_APPL

 

*************************************************************************************************************************************

** Maintain Text Symbols for the program

001 Selection Options

002 From Presentation Server

003 From Application Server

005 File(s) in Pres Serv

006 Application Server Directory

007 Application Server File(s)

008 Directory in Presentation Server

009 File has been uploaded successfully

010 Error while copying the file

011 File has been downloaded succssfully

012 Error while downloading file

013 File has been deleted succssfully

014 Error while deleting file

015 No Files Available

 

**Selection Types:

P_APPL Path in ApplicationServer

P_APPL1 From Application Server

P_CHK1 No

P_CHK2 No

P_DEL Delete File(s)

P_DIR ?...

P_DOWN Download File(s)

P_FILE ?...

P_PRES Path in Pres Serv

P_PRES1 From Presentation Serv

P_UPL Upload File(s) from Pres Serv

 

With Regards,

Giriesh M

How to run SAP query in background and create a file in application server

$
0
0

It is possible to run SAP queries in background and to create a query output as a file in application server.

 

Follow below steps to implement the same.

 

1) As per OSS note 537735 - SAP Query: save to file in the background activate the enhancement SQUE0001 using the t.code SMOD.

 

2) Once the above enhancement is activated, it will add a new radio button option with text "Private file" under the output format block of the Query selection screen.

 

2-4-2014 3-00-13 PM.jpg

3) Create a Z table and maintain the sever filepath in which the files to be stored in application server.

2-4-2014 3-27-48 PM.jpg

4) Go to the function exit "EXIT_RSAQEXCE_001" and do your customized coding in the INCLUDE ZXQUEU01.

 

*Data Declaration.

DATA : c_lv_buf TYPE string,

      c_lv_line TYPE string,

      c_lv_filepath TYPE localfile,

      c_lv_query TYPE aqs_quname.

 

*Field symbols

FIELD-SYMBOLS : <fs_record>TYPEANY,

                <fs_comp>TYPEANY.

 

*Get a Query name from the program

CALLFUNCTION'RSAQ_DECODE_REPORT_NAME'

  EXPORTING

    reportname    = program

  IMPORTING

    query          = c_lv_query

  EXCEPTIONS

    no_query_report = 1

    OTHERS        = 2.

IF sy-subrc <>0.

  MESSAGEID sy-msgid TYPE sy-msgty NUMBER sy-msgno

          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

 

*Select the filepath from ZBSD_T0246 table based

*on the query name and variant.

SELECTSINGLE filepath

  FROM zbsd_t0246

  INTO c_lv_filepath

  WHERE query = c_lv_query

  AND qvariant = syst-slset.

 

IF sy-subrc = 0.

*Open application server file.

  OPENDATASET c_lv_filepath FOROUTPUTINTEXTMODE ENCODING DEFAULT.

  IF sy-subrc = 0.

    CLEAR c_lv_line.

 

*Create header of the file

    LOOPAT listdesc.

      CONCATENATE c_lv_line listdesc-fcol ';'INTO c_lv_line.

    ENDLOOP.

    TRANSFER c_lv_line TO c_lv_filepath.

    CLEAR c_lv_line.

 

*Transfer the data to the file

    LOOPAT datatab ASSIGNING<fs_record>.

      DO.

        ASSIGN COMPONENT sy-index OFSTRUCTURE<fs_record>TO<fs_comp>.

        IF sy-subrc <>0.

          EXIT.

        ENDIF.

        c_lv_buf = <fs_comp>.

        IF sy-index = 1.

          c_lv_line = c_lv_buf.

        ELSE.

          CONCATENATE c_lv_line c_lv_buf INTO c_lv_line SEPARATEDBY';'.

        ENDIF.

        CLEAR c_lv_buf.

      ENDDO.

      TRANSFER c_lv_line TO c_lv_filepath.

      CLEAR c_lv_line.

    ENDLOOP.

 

*Close the file once the datas are transfered.

    CLOSEDATASET c_lv_filepath.

    IF sy-subrc = 0.

 

*File created in path &1

      MESSAGE s483(zbsd_0001)WITH c_lv_filepath.

    ENDIF.

  ENDIF.

ELSE.

 

*File path not maintained in table ZBSD_T0246

  MESSAGE e484(zbsd_0001).

ENDIF.

 

5) Run the query in the background and the files will be created in the application server path maintained in Z-table.

Real estate table relationships

Breakpoint at a select statement of a given DB table

$
0
0

This document is on setting a breakpoint on SELECT statement of a given database table. This is done through debugger script that is available from EHP 6.

Following is an example where a breakpoint will be set on VBAP table queries in VA02 transaction.

 

  1. Go to VA02 and input a sales order number
  2. Enable the debugger through /h in command field
  3. Go to “Script” tab in the debugger and click on the “Load Script” button,  take F4 help and select the report as highlighted in below imageLoad Script.png
  4. Click on “Start Script” button and input the Database table names on whose SELECT statement debugger has to stop and click execution button on the pop up window
  5. Debugger script stops at the given DB tables select statements

Debugger.png

6.    To continue further debugging(stop at given DB table queries) click on “Continue Script” button, highlighted in the above image

SCN Trial Editions: SAP NetWeaver Application Server ABAP 7.4

$
0
0

Latest News

Oct 25, 2013: No country limitation anymore, if you use the direct links below.

Sep 27, 2013: New step-by-step tutorials for setting up your AWS environment.

 

product_32.png

Get your hands on the latest release of SAP NetWeaver Application Server ABAP, learn more about its new capabilities, the programming language enhancements, and test-drive the SAP development tools for Eclipse!

 

You can choose from different SCN trial editions which are provided as pre-configured virtual appliances by the SAP Cloud Appliance Library (free of charge). SAP offers this software based on a 90-day trial and evaluation license agreement.

 

Get Your Free Trial As Virtual Appliance

 

The SCN trials of SAP NetWeaver Application Server ABAP 7.4 are available with two different database flavors, i.e. on SAP HANA (in-memory database) and on SAP MaxDB (classical RDBMS). Both virtual appliances come with a detailed user guide describing how to set up and run these virtual appliances.

 

Light_Bulb_32.pngYou should be familiar with the prerequisites and tutorials on our How-to and FAQ page before you order and run these virtual appliances. We also recommend to set up a billing alert for your AWS charges.

 

To get access to these virtual appliances and run them on your own cloud service provider account please visit the SAP Store, log on with your SCN user and hit the Demo Now button. For questions and feedback please post a message in the corresponding ABAP trial thread.

 

tag_cloud_chart_grey_32.png

AS ABAP 7.4 on SAP HANA
[Trial Edition]

tag_cloud_chart_32.png

AS ABAP 7.4 on SAP MaxDB
[Trial Edition]

tag_cloud_chart_grey_32.png

BW 7.4 on SAP MaxDB*
[Trial Edition]

 

*The SAP NetWeaver Business Warehouse 7.4 trial consists of AS ABAP 7.4 and AS Java 7.4 with usage type BI Java as described in the attached solution guide.

 

Try Out These Sample Applications and Tutorials

 

All trial editions come with a pre-configured developer user, pre-installed sample applications and tutorials explaining new capabilities and technologies. The following tutorials are already available:

 

ABAP for SAP HANA reference scenario

The ABAP for SAP HANA reference scenario offers guides and tutorials including a pre-installed sample application which guide you through the E2E development process and provide sample coding leveraging the code-pushdown paradigm on SAP’s in-memory database. For more information please visit the reference scenario home page or directly consult the corresponding how-to guide by Jens Weiler.

 

How to implement an OData service with SAP NetWeaver Gateway

This how-to guide by Andre Fischer describes how to quickly create an OData service with SAP NetWeaver Gateway. You will learn how to create a data model based on a DDIC structure and implement the corresponding services using the OData channel programming model. For more information please download the how-to guide from SCN.

 

How to build SAPUI5/HTML5 applications consuming OData services

This blog by Bertram Ganz describes the end-to-end process required to develop a SAPUI5/HTML5 application user interface (with table, popup and ux3 shell) consuming a local OData service by SAP NetWeaver Gateway. The created OData service is based on the SAP NetWeaver Enterprise Sales and Procurement Model as a pre-installed demo/proxy application that provides a list of products as business data. For detailed instructions please download the how-to guide from SCN.

 

BW sample scenarios and demo content (for the BW 7.4 trial)

The SAP NetWeaver Business Warehouse 7.4 trial provides pre-activated sample scenarios for selected OLAP functions and integrated planning and contains predefined objects, such as InfoProviders, Queries and Workbooks. For more information please refer to this page. Moreover, you can execute the Open Items Analytics Dashboard.


Create an SAP DMS document attaching a file from the Application Server and checking in an FTP vault with automatic filename creation

$
0
0

Hi all,

 

So, as you can see from the title, I had a very specific requirement. I needed to be able to create a document (those you can open through CV03N) programmatically attaching a file from the application server and with an FTP server that automatically assigns filenames.

 

I searched google/scn extensively for a way to do this or an example and tried a few, but it seems that the configuration options for DMS are so vast that it was unlikely to find an example that suited my needs and my configuration. So I'm sharing my code and my example, hoping that maybe it will be helpful for someone else, and maybe I'll even need it myself in the future.

 

The code ended up being extremely simple, but I assure you I tried so many really complex approaches that I don't even want to remind myself of them again

 

  1. DATA:
  2.       lv_docty  TYPE dokar,
  3.       lv_docnr  TYPE doknr,
  4.       lv_docpr  TYPE doktl_d,
  5.       lv_docvr  TYPE dokvr,
  6.       ls_ret    TYPE bapiret2,
  7.       lt_files  TYPETABLE OF bapi_doc_files2,
  8.       ls_files  LIKELINE OF lt_files,
  9.       ls_documentdata TYPE bapi_doc_draw2.
  10. CLEAR ls_documentdata.
  11. ls_documentdata-documenttype ='ZCL'.
  12. ls_documentdata-description ='Testing DMS'.
  13. ls_documentdata-username = sy-uname.
  14. CLEAR ls_files.
  15. ls_files-originaltype ='1'.
  16. ls_files-storagecategory ='<VAULT NAME HERE>'.
  17. ls_files-docpath ='/tmp/'.
  18. ls_files-docfile ='dms_test4.pdf'.
  19. ls_files-wsapplication ='PDF'.
  20. APPEND ls_files TO lt_files.
  21. CALL FUNCTION'BAPI_DOCUMENT_CREATE2'
  22.   EXPORTING
  23.     documentdata    = ls_documentdata
  24.     pf_ftp_dest     ='SAPFTPA'
  25.     pf_http_dest    ='SAPHTTPA'
  26.   IMPORTING
  27.     documenttype    = lv_docty
  28.     documentnumber  = lv_docnr
  29.     documentpart    = lv_docpr
  30.     documentversion = lv_docvr
  31.     return          = ls_ret
  32.   TABLES
  33.     documentfiles   = lt_files.
  34. IF ls_ret-typeNE'E'.
  35.   CALL FUNCTION'BAPI_TRANSACTION_COMMIT'
  36.     EXPORTING
  37.       wait = abap_true.
  38. ELSE.
  39.   CALL FUNCTION'BAPI_TRANSACTION_ROLLBACK'.
  40. ENDIF.

 

 

And the result:

 

Display Document_ Basic Data Customer Claim (ZCL).png

 

I hope this will be helpful to someone!

 

Best regards,

Bruno

Recently Featured Content in ABAP Development

$
0
0

Considerations for Custom ABAP Code During a Migration to SAP HANA

Considering a migration of your custom code to an AS ABAP 7.4 on SAP HANA system? Then you should read this best practice guide by Eric Westenberger containing important considerations and recommendations.September 27, 2013

 

ABAP language news for SAP NetWeaver 7.4

Don't miss this comprehensive blog series by Horst Keller describing the latest enhancements of the ABAP programming language for the SAP NetWeaver Application Server ABAP 7.4 release.July 23, 2013

 

Now Available! SAP NetWeaver AS ABAP 7.4

SAP NetWeaver AS ABAP 7.4 provides non-disruptive innovations and enhancements for the proven and reliable ABAP technology and is optimized for SAP HANA, Cloud, and Mobile. Learn about the most significant values and capabilities of the SAP NetWeaver AS ABAP 7.4.

 

Learn more about NetWeaver 7.4 in blogs by Bjoern Goerke and Karl Kessler:

SAP NetWeaver 7.4 Made Generally Available (GA)

New landing page published for SAP NetWeaver 7.4

 

Explore the ABAP Development on SAP HANA step by step using ABAP for SAP HANA Reference Scenario Open Items Analytics which is an integral part of the SAP NetWeaver AS ABAP 7.4. May 13, 2013

 

ABAP Development Tools 2.7 are generally available!

http://scn.sap.com/profile-image-display.jspa?imageID=6190&size=72Testdrive the latest version of SAP's ABAP IDE on Eclipse and get familiar with its new features and enhancements. This article by Christopher Kaestner describes the highlights of the ABAP development tools 2.7 and where to download them.May 12, 2013

 

Performance Guidelines for ABAP Development on the SAP HANA Database

If you’re an experienced ABAP developer, you’re probably familiar with the classic performance guidelines for using Open SQL. This begs the question of what changes are there to the guidelines in the context of SAP HANA. Eric Westenberger tackles that question.  April 10, 2013

 

Experience the Magic: How to Setup Your Own ABAP on HANA in the Cloud

http://scn.sap.com/profile-image-display.jspa?imageID=12354&size=72Are you an ABAP developer who can’t wait to explore the intricacies of ABAP on HANA coding? Do you want to set up a sandbox environment where you can try out things such as consuming HANA Calculation Views or Stored Procedures from ABAP programs, and learn how to accelerate your ABAP applications with HANA or build entirely new ones? Then SAP Mentor Thorsten Franz wrote this for you. April 10, 2013

 

ABAP in Eclipse: Why Eclipse wins?

http://scn.sap.com/profile-image-display.jspa?imageID=17269&size=72 What makes working with ABAP in Eclipse more efficient as in SE80? In this blog, Adam Krawczyk shares his practical experience with ABAP Development Tools giving handy tips and advices for optimal usage.April 11, 2013

 

ABAP Code Modularization: Lesson Learned

http://scn.sap.com/profile-image-display.jspa?imageID=3669&size=72It can’t be all Objects all the time! In this blog, Otto Gold shares tips and best practices on how to structure program code depending on the situation. Mine through the comments section and you’ll find more nuggets of wisdom. Mr. Gold provides more nuggets in “My "light" tricks for building more "robust" ABAP code.”March 22, 2013

 

How to Create a Watch Point for a Field Symbol in the ABAP Debugger

You can’t create a watch point for a field symbol. You'll get an error. Try telling that to Brian O'Neill, who said, “Even though I received an error, I do not like being told what I can't do in SAP, so I decided to find a way!” March 18, 2013

 

ABAP for SAP HANA Fitness Contest at DSAG Technology Days

http://scn.sap.com/profile-image-display.jspa?imageID=3662&size=72SAP Mentor Tobias Trapp writes about the ABAP for SAP HANA Fitness Contest at DSAG Technology Days. There 20 customers and partners had the chance to get early insights into what ABAP development on SAP HANA as primary persistence means. March 4, 2013

 

 


SAP TechEd Live Interviews for ABAP Developers

 

Get more interviews and lecture sessions from SAP TechEd Online. January 8, 2012

 

Optimizing ABAP for SAP HANA: SAP's 3-Step Approach

In this SAPinsider article, you'll learn SAP's three-step approach to optimize SAP NetWeaver Application Server (SAP NetWeaver AS) ABAP for the SAP HANA database. December 26, 2012


ABAP Development Tools: Now you can debug ABAP applications in Eclipse

http://scn.sap.com/profile-image-display.jspa?imageID=6190&size=72Want to debug your ABAP applications with native Eclipse debugger directly within the ABAP Development Tools (ADT) for Eclipse? Now it's possible since the availability of the new SAP Kernel 7.21 in combination with SAP Basis 7.31 SP4 (prerequisite for using ADT). Learn the capabilities of the new ABAP debugger in Eclipse also by watching the embedded video. December 3, 2012

 


SAP Insider: Turbocharge Your ABAP Development with Innovation from Eclipse

https://scn.sap.com/profile-image-display.jspa?imageID=2207&size=72With SAP NetWeaver 7.31, support package stack 4, SAP introduces ABAP development tools for SAP NetWeaver, also known as "ABAP in Eclipse," which brings Eclipse capabilities to ABAP Workbench (SE80) functionality. In this SAP Insider article, you'll learn more about ABAP in Eclipse and how it moves ABAP, which is ripe for productivity and usability improvements, into a complementary alignment with SAP's other Eclipse-based development environments. November 26, 2012

 

Crossing the Great Divide - Procedural vs. OO ABAP Programming

http://scn.sap.com/profile-image-display.jspa?imageID=4295&size=72Indulge in this blog by Paul Hardy from Hanson Australia Pty Ltd, as he takes us through his journey from the “old school” (he started procedural programming at age 14) to modern programming techniques. November 6, 2012

 

 

A Call to Arms for ABAP Developers

http://scn.sap.com/profile-image-display.jspa?imageID=2427&size=72 SAP Mentor Graham Robinson shares his concerns for those who have not kept in touch with contemporary development trends including ABAP skills. Read his “call to arms.” October 26, 2012

 

 

 

ABAP Development Tools Tutorials - Learn how to use ABAP in Eclipse

Want to learn fast all new features and capabilities of the ABAP in Eclipse IDE? Just step through the short ABAP Development Tools video tutorials online.October 16, 2012


ABAP Technology @ SAP TechEd 2012

Are you interested in the latest ABAP technology news and visiting one of the upcoming SAP TechEd 2012 events? This blog post gives a brief overview of sessions that might be of interest for you. September 25, 2012


ABAP Test Cockpit – SAP’s new quality assurance tool

Bugs in your custom ABAP code can be quite expensive when they impact critical business processes. Thus, SAP invested in the ABAP Test Cockpit (ATC), SAP’s new quality assurance tool for ABAP. Read this document to learn more about ATC. September 21, 2012


Free Trial on SCN for ABAP in Eclipse

Want to check out ABAP in Eclipse? Simply download the SCN trial version following the ABAP Development Tools for SAP NetWeaver - Trial Version document orvisit the new space focusing on the Eclipse-based ABAP Development Tools for SAP NetWeaver. July 5, 2012


SAP NetWeaver AS ABAP for HANA

How does ABAP help to leverage the benefits of in-memory database technology? This documentdescribes SAP's vision, strategy, development, and commitment to enable ABAP for SAP HANA. Also available in German language.June 25, 2012

 

ABAP in Eclipse is Here!

ABAP in Eclipse was shipped on 25 June with SAP NetWeaver AS ABAP 7.03/7.31 SP4. Visit the new space focusing on the Eclipse-based ABAP Development Tools for SAP NetWeaver, or “ABAP in Eclipse.” Check out Get Started with ABAP Development Tools for SAP NetWeaver, Working with ABAP Development Tools, and Download and Installation Instructions (SMP login required). June 26, 2012

 

"Light" Tricks for Building More "Robust" ABAP Code

http://scn.sap.com/profile-image-display.jspa?imageID=3669&size=72 SAP Mentor Otto Gold shares some thoughts on ABAP coding and general development, and sparks another robust discussion following his blog. Otto offers up more useful tricks in another recent blog, All you need to know about HR-PD Qualifications from the development perspective. June 12, 2012

 

 

Modernizing ABAP Development

Questions about code modernization and skills development tend to leave a big footprint on SCN. In this blog, Brian O'Neill of IGT asks how and whether to modernize. June 12, 2012

 

Customer Feedback on the Pilot Version of the ABAP Development Tools for SAP NetWeaver

http://scn.sap.com/profile-image-display.jspa?imageID=4972&size=72Also known as "ABAP in Eclipse," ABAP Development Tools for SAP NetWeaver were part of a customer engagement initiative to evaluate the pilot version. Olga Dolinskaja summarizes the results. May 3, 2012

 

 

 

Developer's Journal: ABAP/HANA Connectivity via Secondary Database Connection

http://scn.sap.com/profile-image-display.jspa?imageID=2203&size=72

Interested in how to access HANA from your ABAP systems? In his edition of the HANA Developer's Journal Thomas Jung expains how much can be done today when HANA runs as a secondary database for your current ABAP based systems and what development options within the ABAP environment support this  scenario. April 23, 2012


 

 

The quality of an answer depends significantly on the quality of the question (or: how to ask good questions)

In his post Hermann Gahmgives some useful hints how to ask 'good' questions and especially correct questions regarding ABAP code in order to get an answer of a good quality. April 23, 2012

 

ABAP Objects: Performance Analysis (SAT) with ABAP Unit

Posted by Bjorn-Henrik Zink. February 2, 2012

 

How to Do ABAP Nugget Based Code Migration

SAPlink is a project that aims to make it easier to share ABAP developments between programmers. It provides the ability to easily distribute and package custom objects. This article covers ABAP basis versions compatible with SAPlink and how to install the latest version of SAPlink. January 26, 2012

 

ABAP Keyword Documentation 7.03/7.31

The ABAP Keyword Documentation for Release 7.31 aka 7.03 is online. January 14, 2012

 

Coding and Performance Tips for New ABAP Programmers

In this blog, SAP Technology Analyst, Nabheet Madan, offers tips for new ABAP programmers who have just developed a few objects. Nabheet looks at fundamentals including documentation and reusable code, naming conventions, maintainability and performance optimization. January 3, 2012

 

2011

 

ABAP Trilemma

The ABAP development triangle is a model that describes the trilemma of ABAP development. In this blog, Elvez describes how the ABAP development triangle - performance, security and design - can be used as an agreement between developers on how to prioritize development efforts. December 13, 2011

Featured Content for ABAP Development

$
0
0

ABAP Language News for Release 7.40 SP05

SP05 for AS ABAP 7.40 comes with a new kernel release 741 and a new kernel release means new ABAP language features. Read this blog by Horst Keller covering the most important ABAP language news.February 6, 2014

 

What is ANST and why aren't you using it?

Do you already know ANST, the Automated Notes Search Tool? This powerful application searches SAP notes for a specific problem based on the issue in your system. For more information, read this blog by Kristen Scheffler.January 9, 2014

 

ABAP Developement Tools for Eclipse 2.19

The ABAP Development Tools for Eclipse 2.19 are available as of today! Read this interesting blog by Thomas Fiedler to find out what's new and where to get the latest version.December 20, 2013

 

SQL Monitor Unleashed

Have you heard about the SQL Monitor already? It can be used to detect custom code which can be optimized (in the context of the migration to SAP HANA, but also independent of that). If you like to learn more, read Johannes Marbach's blog series. You find the first blog here.November 18, 2013

 

Transfer Data between SAP Systems/developers without STMS (using SAPLink)

$
0
0

Hi SCN,

 

Using STMS is the standard and easiest way of transporting data between your linked SAP Systems.
However, if the SAP Systems are not linked and you wish to share any sort of data between the two SAP Systems or developers, keep on reading.

 

I was looking for a way to transport a program which I created on SAP System X to SAP System Y.

The easiest and fastest way for me, to transport ABAP developments between two independent systems, was to use SAPLink.

"     SAPLink is an open source project that aims to make it easier to share ABAP developments betwen programmers.
      It provides the ability to easily distribute and package custom objects.     "

(Source: saplink)

 

In this tutorial I'll explain how to install and configure SAPLink into your SAP System and how to transfer data using SAPLink.

 

Installation and configuration of SAPLink into your SAP System

 

  1. Download and extract the SAPLink installation files to your file system (Downloads -  saplink)
    (Note: it is advised to install a stable release and not a beta, or even alpha, version)
  2. If you don’t have a package yet to save the objects you will create in the following steps, create one now in transaction SE80.
  3. Create a new executable program in transaction SE38 (when asked for a package, save as local object since this program only handles the installation and will only be run once) and copy the code from the “ZSAPLINK_INSTALLER.TXT” into the program (which you extracted in step 1).
    Make sure to change the report statement at the top of the page to the name of your program. Save, activate and execute your program afterwards.
  4. The following screen will appear:
    a.png
    Select the “NUGG_SAPLINK-0.1.4” file (0.1.4 may be different version when you downloaded another release) from your file system which you extracted in step 1.

    If you want to overwrite a previous installation, you can flag the “Overwrite Originals” checkbox.

    Execute the report and when asked, enter the package (step 2) you will be using for SAPLink.
  5. When the installation (objects are created) was successful the following screen will appear:
    a.png
  6. Now the objects need to be activated:
    1. For classes go to transaction SE24, enter the name of the class and press activate.
      Repeat this for every class mentioned in the screen above.
    2. For programs go to transaction SE38, enter the name of the program and press activate. For programs you also have to activate a STATUS.              To do this go to transaction SE41, enter the program name and press F4 in the STATUS field. The value “SELOBJ” will appear; now press activate.
    3. If you want to activate multiple inactive files at the same time, do following steps:
      Transaction SE80 > Select “Inactive Objects” > Enter your username > Display > Right-click (on the objects that needs to activated) > Activate
      a.png
  7. You can now execute the “ZSAPLINK” program in transaction SE38.
    The following screen will appear:
    a.png
    The “Nugget” tab is for handling “.nugg” files and the “Slinkee” tab for handling “.slnk” files.
    These files can be used for importing plugins (extensions of original functionality, see underneath
    step 8) or be created for the export of SAP objects (data that needs to be transferred, see underneath step 9).
  8. Plugins can be download from the following website: SAPlink plugin list.
    (these plugins extend the posibilities of what you can export)

    Click on the desired plugin, download it to your file system and choose to import the plugin file (either nugget or slinkee depending in file extension) in the program ZSAPLINK.

    On success the following screen will appear:
    a.png
    Note: don’t forget to activate the installed components (see step 6)
  9. You'll have to install the ZSAPLINK program and plugins on both the source and target SAP System.

 

Export custom objects from source SAP System

 

  1. Execute “ZSAPLINK” program (transaction SE38)
  2. Select “Create New Nugget”, enter the desired nugget name and press execute:
    Navigate to the location where you want to save the file and press “Save”.
    (The system will ask you if you want to allow the SAP system from accessing the file system, press “Allow”)

    a.png
  3. Now specify which object you want to add to the nugget, in this case the whole package:
    You specify which object/package you want to add to the Nugget, where the Nugget is located (see previous step) and press “Execute”.

    a.png
  4. In the next screen, select what you want to add from the package and press the green wink:
    NOTE: To be able to select all the objects, I had to install some plugins.
    The amount of plugins you have to install, depends on what you want to transfer (e.g.: if you want to transfer Adobe Forms objects, you’ll need to install the PDF Forms and PDF Interface plugins - see step 8 from SAPLink installation).

    You can select every object (after installing plugins) except the package itself.
    a.png
    If all objects are succesfully copied to the Nugget a green light will appear in the "Exception" column.
    The objects are now stored in the ".nugg" file which you specified before.


Import custom objects in target SAP System

 

  1. Create a new package, for the Nugget that you will be importing, in transaction SE80
  2. Go to transaction SE38 and run the ZSAPLINK program.
  3. Choose to “Import Nugget” and look up the “Nugget File Name” from the file system on the location where you exported it to.
    Note: It is possible that not all objects can be imported at the first import because of the order of imports. Just run the “Import Nugget” a second time, this time with the “Overwrite Originals” checkbox flagged.
  4. When you import the Nugget, all objects are added to the “$TMP” package.
    You need to add all the objects to the package you created in step 1.
    Go to SE80 > Inactive Objects > Enter Username OR SE80 > Package > Enter "$TMP"
    Select all the objects that needs to be transferred to your package, right-click on your selection and choose “Change Package Assignment”.
  5. Select the objects one by one after the “Change Package Assignment” and activate them.

 

All your objects are now present and usable in the target SAP System.

If you have any questions, feel free to contact me.


Regards,

 

Niels

How to set up and run the developer and trial editions provided as virtual appliance

$
0
0

The following document references the most important guides and tutorials for creating, running and operating these developer and trial editions provided as virtual appliances by the SAP Cloud Appliance Library. For questions and feedback please post a message in this thread.

 

Prerequisites

 

 

Tutorials and Guides

 

  • This step-by-step tutorial shows you how to set up a virtual private cloud (VPC) with VPN access on AWS (Amazon Web Services) and launch your trial instance into the private subnet of this VPC.
  • Alternatively, this step-by-step tutorial describes how to get your trial instance up and running on AWS with minimal effort - but less secure.
  • Watch the following video tutorial [5min] to learn how to get and set up a trial instance in your SAP Cloud Appliance Library account:

  • For detailed information about how to set up your local environment and your local clients and how to connect to your trial instance you can watch the following video tutorial:

 

Frequently Asked Questions

 

Which countries does the SAP Store currently support?

If you use the Demo Now link in the SAP Store the known country limitation of the SAP Store should be resolved.

 

Is it completely free to use the trial editions of these virtual appliances?

To be precise: SAP offers you to instantiate and run these virtual appliances using the SAP CAL test drive center completely for free (according to the terms and conditions). But you have to pay the charges of your cloud service provider hosting these trial instances (without any involvement of SAP).

 

Do the different trial variants have an impact on the charges of my cloud service provider?

Yes, as an AS ABAP on SAP HANA trial instance requires more virtual CPUs and memory than an AS ABAP on MaxDB trial instance you should use the appropriate instance type/size recommended by the instance creation wizard. This has an impact on the charges of your cloud service provider as shown in the cost forecast of your SAP CAL account.

 

Ok, but how do I find out what my cloud service provider charges for these trial instances?

You have two options:

a) The instance creation wizard of the SAP Cloud Appliance Library offers a detailed cost forecast (you could still cancel the creation process).

b) You can take a look at the Amazon EC2 price list for the recommended instance types: x2.4xlarge (AS ABAP on SAP HANA), m1.large (AS ABAP on SAP MaxDB)

 

So how do I run these trial instances cost-effectively on AWS?

Hosting the trial instances on AWS comprises EC2 services (Elastic Compute Cloud) and EBS services (Elastic Block Store). If you suspend the trial instance there are no costs for EC2 services anymore, but still low costs for EBS services. If you terminate your trial instances, there are also no costs for EBS services anymore. Thus, we recommend to use the 'activate and suspend manually' option, which is part of the instance creation wizard or available within the properties of your existing instance. To be on the safe side, you can also activate a billing alarm in your AWS account.

 

How often do you plan to update the trial editions of these virtual appliances?

We plan to offer a new virtual appliance for every major release and enhancement package of AS ABAP. But we are not going to build and publish new trial appliances for every upcoming support package - maybe some major/important ones.

 

The virtual appliance has been updated, what does this mean for me?

Your existing CAL test drive center subscription is still valid and all created instances remain unaffected. Only if you create a new instance the latest version of the trial edition will be instantiated.

 

What's the difference between public network access and corporate network access in the instance creation wizard?

In simplified terms, with the public network option you get a public IP address to directly access your trial instance (no VPN required) with all implications on privacy and security. With the corporate network option you get a private IP address from the address range of a subnet within your virtual private cloud (VPC). For more information please consult the VPC user guide.

Finding a user exit - code to do so

$
0
0

This is some code that I have archived on another site:

 

It specifies in it's initial comments the primary contributers to the best of my knowledge.

 

Good luck!

 

*&---------------------------------------------------------------------*

*& Report  Z_FIND_USEREXIT_RNW

*&

*&---------------------------------------------------------------------*

*&

*&

*&---------------------------------------------------------------------*

 

*&---------------------------------------------------------------------*

*& Report  Z_FIND_EXIT

*&

*&---------------------------------------------------------------------*

*&

 

*I'm thinking that this is based on a post by

*

*SimonaD86 in http://sap.

*ittoolbox.com/groups/technical-functional/sap-abap/determinate-the-transaction-that-called-a-certain-userexitfrom-the-user-exit-2760810

*

*or  santoshkj in http://sap.

*ittoolbox.com/groups/technical-functional/sap-dev/developing-screen-exits-in-sap-520079

*

*or Deertay in http://sap.

*ittoolbox.com/groups/technical-functional/sap-dev/user-exit-for-a-transaction-code-mb1bmigo-1155130

 

 

*&

*&---------------------------------------------------------------------*

 

REPORT  z_find_exit.

 

TABLES : tstc,

         tadir,

         modsapt,

         modact,

         trdir,

         tfdir,

         enlfdir,

         sxs_attrt ,

         tstct.

 

DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.

DATA : field1(30).

DATA : v_devclass LIKE tadir-devclass.

 

PARAMETERS : p_tcode LIKE tstc-tcode,

             p_pgmna LIKE tstc-pgmna .

 

DATA wa_tadir TYPE tadir.

 

START-OF-SELECTION.

 

  IF NOT p_tcode IS INITIAL.

    SELECT SINGLE * FROM tstc WHERE tcode EQ p_tcode.

 

  ELSEIF NOT p_pgmna IS INITIAL.

    tstc-pgmna = p_pgmna.

  ENDIF.

 

  IF sy-subrc EQ 0.

    SELECT SINGLE * FROM tadir

           WHERE pgmid = 'R3TR'

             AND object = 'PROG'

             AND obj_name = tstc-pgmna.

 

    MOVE : tadir-devclass TO v_devclass.

 

    IF sy-subrc NE 0.

      SELECT SINGLE * FROM trdir

             WHERE name = tstc-pgmna.

      IF trdir-subc EQ 'F'.

        SELECT SINGLE * FROM tfdir

               WHERE pname = tstc-pgmna.

 

        SELECT SINGLE * FROM enlfdir

               WHERE funcname = tfdir-funcname.

 

        SELECT SINGLE * FROM tadir

               WHERE pgmid = 'R3TR'

                 AND object = 'FUGR'

                 AND obj_name EQ enlfdir-area.

 

        MOVE : tadir-devclass TO v_devclass.

      ENDIF.

    ENDIF.

 

    SELECT * FROM tadir INTO TABLE jtab

           WHERE pgmid = 'R3TR'

             AND object IN ('SMOD', 'SXSD')

             AND devclass = v_devclass.

 

    SELECT SINGLE * FROM tstct

           WHERE sprsl EQ sy-langu

             AND tcode EQ p_tcode.

 

    FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.

    WRITE:/001(19) 'Transaction Code - ',

           020(20) p_tcode,

           045(50) tstct-ttext.

    SKIP.

    IF NOT jtab[] IS INITIAL.

      WRITE:/(105) sy-uline.

      FORMAT COLOR COL_HEADING INTENSIFIED ON.

 

*Sorting the internal Table

      SORT jtab BY object.

      DATA : wf_txt(60) TYPE c,

             wf_smod TYPE i ,

             wf_badi TYPE i ,

             wf_object2(30) TYPE c.

      CLEAR : wf_smod, wf_badi , wf_object2.

 

*Get the total SMOD.

 

      LOOP AT jtab INTO wa_tadir.

 

        AT FIRST.

          FORMAT COLOR COL_HEADING INTENSIFIED ON.

 

          WRITE:/1 sy-vline,

          2 'Enhancement/ Business Add-in',

          41 sy-vline ,

          42 'Description',

          105 sy-vline.

          WRITE:/(105) sy-uline.

        ENDAT.

        CLEAR wf_txt.

 

        AT NEW object.

          IF wa_tadir-object = 'SMOD'.

            wf_object2 = 'Enhancement' .

          ELSEIF wa_tadir-object = 'SXSD'.

            wf_object2 = ' Business Add-in'.

 

          ENDIF.

          FORMAT COLOR COL_GROUP INTENSIFIED ON.

 

          WRITE:/1 sy-vline,

 

          2 wf_object2,

          105 sy-vline.

        ENDAT.

 

        CASE wa_tadir-object.

          WHEN 'SMOD'.

            wf_smod = wf_smod + 1.

            SELECT SINGLE modtext INTO wf_txt

            FROM modsapt

            WHERE sprsl = sy-langu

            AND name = wa_tadir-obj_name.

            FORMAT COLOR COL_NORMAL INTENSIFIED OFF.

 

          WHEN 'SXSD'.

 

*For BADis

            wf_badi = wf_badi + 1 .

            SELECT SINGLE text INTO wf_txt

            FROM sxs_attrt

            WHERE sprsl = sy-langu

            AND exit_name = wa_tadir-obj_name.

            FORMAT COLOR COL_NORMAL INTENSIFIED ON.

 

        ENDCASE.

 

        WRITE:/001 sy-vline,

               002 wa_tadir-obj_name HOTSPOT ON,

               041 sy-vline ,

               042 wf_txt,

               105 sy-vline.

        AT END OF object.

          WRITE : /(105) sy-uline.

        ENDAT.

 

      ENDLOOP.

 

      WRITE:/(105) sy-uline.

 

      SKIP.

      FORMAT COLOR COL_TOTAL INTENSIFIED ON.

      WRITE:/ 'No. of Exits:' , wf_smod.

      WRITE:/ 'No. of BADis:' , wf_badi.

 

    ELSE.

      FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.

      WRITE:/(105) 'No userexits or BADis exist'.

    ENDIF.

  ELSE.

    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.

    WRITE:/(105) 'Transaction does not exist'.

  ENDIF.

 

AT LINE-SELECTION.

 

  DATA : wf_object TYPE tadir-object.

  CLEAR wf_object.

 

  GET CURSOR FIELD field1.

  CHECK field1(8) EQ 'WA_TADIR'.

  READ TABLE jtab WITH KEY obj_name = sy-lisel+1(20).

  MOVE jtab-object TO wf_object.

 

  CASE wf_object.

    WHEN 'SMOD'.

      SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).

 

      CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.

    WHEN 'SXSD'.

      SET PARAMETER ID 'EXN' FIELD sy-lisel+1(20).

      CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.

  ENDCASE.

How to run SAP query in background and create a file in application server

$
0
0

It is possible to run SAP queries in background and to create a query output as a file in application server.

 

Follow below steps to implement the same.

 

1) As per OSS note 537735 - SAP Query: save to file in the background activate the enhancement SQUE0001 using the t.code SMOD.

 

2) Once the above enhancement is activated, it will add a new radio button option with text "Private file" under the output format block of the Query selection screen.

 

2-4-2014 3-00-13 PM.jpg

3) Create a Z table and maintain the sever filepath in which the files to be stored in application server.

2-4-2014 3-27-48 PM.jpg

4) Go to the function exit "EXIT_RSAQEXCE_001" and do your customized coding in the INCLUDE ZXQUEU01.

 

*Data Declaration.

DATA : c_lv_buf TYPE string,

      c_lv_line TYPE string,

      c_lv_filepath TYPE localfile,

      c_lv_query TYPE aqs_quname.

 

*Field symbols

FIELD-SYMBOLS : <fs_record>TYPEANY,

                <fs_comp>TYPEANY.

 

*Get a Query name from the program

CALLFUNCTION'RSAQ_DECODE_REPORT_NAME'

  EXPORTING

    reportname    = program

  IMPORTING

    query          = c_lv_query

  EXCEPTIONS

    no_query_report = 1

    OTHERS        = 2.

IF sy-subrc <>0.

  MESSAGEID sy-msgid TYPE sy-msgty NUMBER sy-msgno

          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

 

*Select the filepath from ZBSD_T0246 table based

*on the query name and variant.

SELECTSINGLE filepath

  FROM zbsd_t0246

  INTO c_lv_filepath

  WHERE query = c_lv_query

  AND qvariant = syst-slset.

 

IF sy-subrc = 0.

*Open application server file.

  OPENDATASET c_lv_filepath FOROUTPUTINTEXTMODE ENCODING DEFAULT.

  IF sy-subrc = 0.

    CLEAR c_lv_line.

 

*Create header of the file

    LOOPAT listdesc.

      CONCATENATE c_lv_line listdesc-fcol ';'INTO c_lv_line.

    ENDLOOP.

    TRANSFER c_lv_line TO c_lv_filepath.

    CLEAR c_lv_line.

 

*Transfer the data to the file

    LOOPAT datatab ASSIGNING<fs_record>.

      DO.

        ASSIGN COMPONENT sy-index OFSTRUCTURE<fs_record>TO<fs_comp>.

        IF sy-subrc <>0.

          EXIT.

        ENDIF.

        c_lv_buf = <fs_comp>.

        IF sy-index = 1.

          c_lv_line = c_lv_buf.

        ELSE.

          CONCATENATE c_lv_line c_lv_buf INTO c_lv_line SEPARATEDBY';'.

        ENDIF.

        CLEAR c_lv_buf.

      ENDDO.

      TRANSFER c_lv_line TO c_lv_filepath.

      CLEAR c_lv_line.

    ENDLOOP.

 

*Close the file once the datas are transfered.

    CLOSEDATASET c_lv_filepath.

    IF sy-subrc = 0.

 

*File created in path &1

      MESSAGE s483(zbsd_0001)WITH c_lv_filepath.

    ENDIF.

  ENDIF.

ELSE.

 

*File path not maintained in table ZBSD_T0246

  MESSAGE e484(zbsd_0001).

ENDIF.

 

5) Run the query in the background and the files will be created in the application server path maintained in Z-table.


Guides and Tutorials for the Developer Edition of AS ABAP incl. BW on SAP HANA

$
0
0

The Developer Edition of AS ABAP incl. BW on SAP HANA comes with pre-configured users and pre-installed sample applications. Thus, you can immediately start developing or trying out new capabilities and code samples. Please find below a list of guides and tutorials which are already implemented in or are applicable for this developer edition.


Remark: Some of these guides and tutorials can only be used on SAP HANA, others also apply to AnyDB systems, e.g. the AS ABAP on MaxDB trial. Thus, all guides and tutorials are labeled accordingly*.


SAP HANA Developer Guide [SAP HANA*]

This guide explains how to build applications using SAP HANA, including how to model data, how to write procedures, and how to build application logic in SAP HANA Extended Application Services (SAP HANA XS).


SHINE: SAP HANA Interactive Education [SAP HANA*]

SAP HANA Interactive Education, or SHINE, is a demo application that makes it easy to learn how to build

native SAP HANA applications. The demo application comes with sample data and design-time developer objects for the application's database tables, data views, stored procedures, OData, and user interface.

 

ABAP for SAP HANA Reference Scenario [SAP HANA*]

The ABAP for SAP HANA reference scenario offers guides and tutorials including a pre-installed sample application which guide you through the E2E development process and provide sample coding leveraging the code-pushdown paradigm on SAP’s in-memory database. For more information please visit the reference scenario home page or directly consult the corresponding how-to guide by Jens Weiler.


Business Warehouse Scenarios [SAP HANA*]

The developer edition includes SAP Business Warehouse 7.4 which provides pre-activated sample scenarios for selected OLAP functions and integrated planning. Moreover, it contains predefined objects, such as InfoProviders, Queries and Workbooks. For more information please refer to this page or use transaction RSFC directly in the system.

 

How to implement an OData service with SAP NetWeaver Gateway [AnyDB*]

This how-to guide by Andre Fischer describes how to quickly create an OData service with SAP NetWeaver Gateway. You will learn how to create a data model based on a DDIC structure and implement the corresponding services using the OData channel programming model. For more information please download the how-to guide from SCN.


How to build SAPUI5/HTML5 applications consuming OData services [AnyDB*]

This blog by Bertram Ganz describes the end-to-end process required to develop a SAPUI5/HTML5 application user interface (with table, popup and ux3 shell) consuming a local OData service by SAP NetWeaver Gateway. The created OData service is based on the SAP NetWeaver Enterprise Sales and Procurement Model as a pre-installed demo/proxy application that provides a list of products as business data. For detailed instructions pleasedownload the how-to guide from SCN.


GENERIC EXTRACTION FROM R3 TO BI

$
0
0

Introduction

 

Generic Extractor is mainly used for extracting the data from other Source Systems like R/3 to BI.To extract the required Data we need to create the Data Source. Here In this document we will see the various steps involved to create a Custom Data Source.

 

Creation of Structure

Create a structure with the necessary fields.

1.png

2.png

  Please note the Currency and quantity  fields must have reference fields also.


Creation of Function Module

In transaction SE80,Select Function group, name RSAX. Right click and Copy.

3.png


Creation of Function Module

In transaction SE80, Select Function group, name RSAX. Right click and Copy.

4.png

 

  Give the New Name as ZRSAX_FICOPA

5.png

 

6.png

 

Select the required function Module.

 

7.png


  Give the name for Function Module (For Eg ZMFA_GET_DATA_PA)

 

The Function Module in SE37 will be like this, we haveto do light modification


In table tables Tab Maintain the entries as per the below screen shots

8.png


In Source code Tab. Write this Code


CODE :  Please see the attachment.

 

Now Save, Activate the function module.

Go to SE80 -> Select Function Group, Activate the Function Group.

 

Note:If you do not activate  function Group, You will not be able to create data source in RS02.


Data Source Creation

Then you have to create the data source, the data source name must be the name given in the source code of the Function module.


RSO2 -> Create

9.png


Select Extraction by Function Module, Give name of Applc component, Function Module, Extract Structure, Save.

10.png


Checking Extraction

Now give the selection Conditions and save.

RSA3 ->Give data source name and check extraction

11.png


Click on Display ALV result

12.png

Creating radio buttons on popup window

$
0
0

                                                       create  radio buttons on popup window

 

 

1) Go to transaction SE37 and enter function module name 'K_KKB_POPUP_RADIO2'.

 

1.png 
 
2)   Enter details as mention and Execute.

 

2.png

Display Check box in SAP Smart Forms

$
0
0

Display Check box in SAP Smart Forms

 

 

 

 

 

1.0  Overview

 

This document describes the methodology and approach to display the Check box in SAP Smart forms for Space Optimization in printing when printed on Laser Jet Printers, which results in cost reduction of paper printing.

 

 

2.0  Scope

 

The approach specified in this document is applicable to all the printing on laser jet printers (PCL), where we want to optimize the space utilization in printing.

 

 

 

3.0 Steps to displayed the check box

 

 

  1. Create a smart form with all necessary windows containing information to be displayed.
  2. In order to print the check box selects the required window for e.g. CHEAKBOX window .
  3. In general attribute Tab insert the SAP Symbol by clicking in Editor Button  
  4. Click on include-> Characters ->SAP symbol pop up screen will appear.
  5. Double click on selected checkbox symbol you can see the code 697 in editor.
  6. Text 697 id the code for selected checkbox.
  7. Repeat this procedure for unchecked box (Code 727).

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


How to create dynamic variable knowing reference tabname and fieldname

$
0
0

Original of this article is at (oprsteny.com)

 

 

If you want to create a variable during runtime knowing only the reference table name and its field name (in string form), you can achieve it following the code presented in this article

 

 

data:
* Names of the table and its field  g_tabname type tabname,  g_fieldname type fieldname,

* Data references to table and its field
  gr_data_line type ref to data,  gr_data_field type ref to data,

* Testing values
  g_test_value1 type char255 value '2021_error',  g_test_value2 type char255 value '2021'.

FIELD-SYMBOLS:
  <fs_table_line> type any,  <fs_table_line_field> type any.

* We want to create dynamic variable of type MARC-WERKS
g_tabname = 'MARC'.
g_fieldname = 'WERKS'.

*Create dynamic line of given table name
CREATE DATA gr_data_line TYPE (g_tabname).
ASSIGN gr_data_line->* to <fs_table_line>.

*Get reference to the required field
ASSIGN COMPONENT g_fieldname  OF STRUCTURE <fs_table_line> to <fs_table_line_field>.
CHECK sy-subrc = 0.

*Create dynamic variable with the same "structure" like the table field
CREATE DATA gr_data_field LIKE <fs_table_line_field>.

*Validation of data entered (not using either check or value table)
*just to make sure the value entered is accepted
<fs_table_line_field> = g_test_value1.
if <fs_table_line_field> = g_test_value1.  write:/ 'OK'.
else.  write:/ 'Error'.
endif.<fs_table_line_field> = g_test_value2.
if <fs_table_line_field> = g_test_value2.  write:/ 'OK'.
else.  write:/ 'Error'.
endif.
Viewing all 935 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>