9 Ağustos 2017 Çarşamba

create procedure and call on hana

create procedure on hana:


PROCEDURE "MAINTENANCE"."maintenance.procedures::get_userInfo"(
IN im_USER       "MAINTENANCE"."TT_USERLOGIN",
    OUT ex_userInfo  "MAINTENANCE"."TT_USERINFO" )
 LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER
--DEFAULT SCHEMA <default_schema_name>
READS SQL DATA AS
BEGIN
 /*****************************
Write your procedure logic
 *****************************/
 declare lv_EMPLOYEEID nvarchar(10);
 declare lv_password nvarchar(1000);


select EMPLOYEEID,PASSWORD
     into lv_EMPLOYEEID,lv_password
                      from :im_USER;
                   
                   
 ex_userInfo = select * from "MAINTENANCE"."EMPLOYEES"
               where EMPLOYEEID = :lv_EMPLOYEEID and
                     PASSWORD   = :lv_password;
END;

----call procedure----------

drop table #LOGINUSER;
CREATE LOCAL TEMPORARY COLUMN TABLE #LOGINUSER LIKE "MAINTENANCE"."TT_USERLOGIN";
INSERT INTO #LOGINUSER VALUES ('1001','ADMIN');

call "MAINTENANCE"."maintenance.procedures::get_userInfo"( #LOGINUSER,
                                                           ?)

8 Ağustos 2017 Salı

Odata service with error: Service exception: insufficient privilege

Odata service with error: Service exception: insufficient privilege 

hatasının çözümü için 2 yol önerebilirim.
1- *.hdbrole oluşturup,ilgili kullanıcıya bu yetkiyi vermek.

  role pXXXtrial.mybackend::role_name{
    catalog schema "WORKSHOP_01": SELECT,UPDATE,INSERT,DELETE;
}
daha sonra oluşturduğunuz role ilgili kullanıcıya vermek.
CALL "HCP"."HCP_GRANT_ROLE_TO_USER"('pXXXtrial.mybackend::role_name','pXXX');


2-Bu yöntemde ise manuel role yaratıp ilgili kullanıcılara atamak.
 


2 Ağustos 2017 Çarşamba

SAP Hana Attribute Views export SQL

Hana sisteminde oluşturduğunuz attribute Views'leri ,
_SYS_BIC --> Column Views ,
çift tıklayarak export SQL yapabilirsiniz.




Getting the "Cannot get the data provider outline" Error due to "insufficient privilege: Not authorized"

Eclipse de attribute view de karşınıza çıkan hatayı aşağıdaki şekilde düzeltebilirsiniz:

Getting the "Cannot get the data provider outline" Error due to "insufficient privilege: Not authorized"


SQL command dan aşağıdaki gibi çalıştırın :

GRANT SELECT ON SCHEMA "<schema name>" TO _SYS_REPO WITH GRANTOPTION

13 Haziran 2017 Salı

FP06 account maintaince FKK_CREATE_DOC_AND_CLEAR


        clear ls_sfkkko.
        ls_sfkkko-fikey lv_fikey.
        ls_sfkkko-applk 'R'.
        ls_sfkkko-blart 'HB'.
        ls_sfkkko-herkf '03'.
        ls_sfkkko-waers 'TRY'.
        ls_sfkkko-bldat sy-datum.
        ls_sfkkko-budat sy-datum.
        ls_sfkkko-wwert sy-datum.

        refresh lt_fkkcl.
        clear ls_fkkcl.
        move-corresponding ls_interest to ls_fkkcl.
        ls_fkkcl-augrd '08'.
        ls_fkkcl-xaktp 'X'.
        concatenate 'B' ls_fkkcl-opbel into ls_fkkcl-azvdg
        ls_fkkcl-augbw ls_fkkcl-betrw.
        ls_fkkcl-augbh ls_fkkcl-betrh.
        ls_fkkcl-augb2 ls_fkkcl-betr2.
        ls_fkkcl-augb3 ls_fkkcl-betr3.
        ls_fkkcl-augbo ls_fkkcl-oribt.
        ls_fkkcl-naugw ls_fkkcl-betrw.
        ls_fkkcl-naugh ls_fkkcl-betrh.
        ls_fkkcl-naug2 ls_fkkcl-betr2.
        ls_fkkcl-naug3 ls_fkkcl-betr3.
        ls_fkkcl-naugo ls_fkkcl-oribt.
        ls_fkkcl-nettw ls_fkkcl-betrw.
        ls_fkkcl-netth ls_fkkcl-betrh.
        ls_fkkcl-nett2 ls_fkkcl-betr2.
        ls_fkkcl-nett3 ls_fkkcl-betr3.
        ls_fkkcl-netto ls_fkkcl-oribt.
        ls_fkkcl-oribt ls_fkkcl-betrw.
        ls_fkkcl-orisk ls_fkkcl-betrh.
        ls_fkkcl-oriwa 'TRY'
        append ls_fkkcl to lt_fkkcl.

        clear ls_fkkcl.
        move-corresponding ls_credit to ls_fkkcl.
        ls_fkkcl-augrd '08'.
        ls_fkkcl-xaktp 'X'.
        concatenate 'B' ls_fkkcl-opbel into ls_fkkcl-azvdg.
        ls_fkkcl-augbw ls_fkkcl-betrw.
        ls_fkkcl-augbh ls_fkkcl-betrh.
        ls_fkkcl-augb2 ls_fkkcl-betr2.
        ls_fkkcl-augb3 ls_fkkcl-betr3.
        ls_fkkcl-augbo ls_fkkcl-oribt.
        ls_fkkcl-naugw ls_fkkcl-betrw.
        ls_fkkcl-naugh ls_fkkcl-betrh.
        ls_fkkcl-naug2 ls_fkkcl-betr2.
        ls_fkkcl-naug3 ls_fkkcl-betr3.
        ls_fkkcl-naugo ls_fkkcl-oribt.
        ls_fkkcl-nettw ls_fkkcl-betrw.
        ls_fkkcl-netth ls_fkkcl-betrh.
        ls_fkkcl-nett2 ls_fkkcl-betr2.
        ls_fkkcl-nett3 ls_fkkcl-betr3.
        ls_fkkcl-netto ls_fkkcl-oribt.
        ls_fkkcl-oribt ls_fkkcl-betrw.
        ls_fkkcl-orisk ls_fkkcl-betrh.
        ls_fkkcl-oriwa 'TRY'.
        append ls_fkkcl to lt_fkkcl.

        refresh lt_enqtab.
        clear ls_engtab.
        ls_engtab-bukrs ls_head-bukrs.
        ls_engtab-gpart ls_head-gpart
        ls_engtab-uname sy-uname.
        append ls_engtab to lt_enqtab.

        call function 'FKK_OPEN_ITEM_ENQUEUE'
          exporting
            i_shared 'X'
          tables
            t_enqtab lt_enqtab.

        call function 'FKK_CREATE_DOC_AND_CLEAR'
          exporting
            i_fkkko       ls_sfkkko
            i_update_task 'X'
          importing
            e_opbel       e_opbel
          tables
            t_fkkopk      lt_fkkopk
            t_fkkcl       lt_fkkcl
          exceptions
            error_message 1.
        if sy-subrc 0.
          commit work and wait.
        endif.

        call function 'FKK_OPEN_ITEM_DEQUEUE'.

8 Haziran 2017 Perşembe

Serial number table in Delivery document(VL02,VL02n)

  call function 'SERNR_ADD_TO_LS'
      exporting
        profile               lips-serail
        material              lips-matnr
        m_charge              lips-charg
        quantity              lf_anzsn
        j_vorgang             =  'PMS3' 
        cuobj                 lips-cuobj
        document              lips-vbeln
        item                  lips-posnr
        debitor               likp-kunnr
        vbtyp                 likp-vbtyp
        bwart                 lips-bwart
      importing
        anzsn                 lips-anzsn
        zeilen_id             lf_line_id
      tables
        sernos                lt_sernos
      exceptions
        serialnumber_errors   1
        serialnumber_warnings 2.
if sy-subrc eq 0.
 
*  call submit program !!!if you don't call not update delivery
      perform serial_liste_post_ls in program saplipw1.
      commit work.
    endif.

7 Mart 2017 Salı

Setup automatic email trigger for ABAP Short Dumps in the system

1. Business Scenario

As a system performance improvement measure, the requirement is to send an email to the team with a list of ABAP Short Dumps that occur in the system during the day.
The email needs to be sent at 12:00 AM, and should contain a list of all the short dumps that have occurred in the system during the previous day.

2. Create a variant for the ABAP Runtime Error program RSSHOWRABAX

  1. Go to SE38 and enter the program name RSSHOWRABAX. Select the Variants Radio button and click display.
        In the next screen, enter the Variant Name and create.
          /wp-content/uploads/2015/08/img1_779336.jpg
     2. This takes you to the Parameters screen, where we need to add the parameters that we want our variant to contain.
          /wp-content/uploads/2015/08/img2_779337.jpg
     3. Click on Attributes. Enter the description.
          /wp-content/uploads/2015/08/img3_779338.jpg
     4. Since our requirement is to execute the variant for the previous day, we will select the following options for ‘Date’ in the ‘Objects for Selection Screen’ section
                  – Selection Variable = ‘X’ (X: Dynamic Date Calculation (System Date))

               /wp-content/uploads/2015/08/img4_779339.jpg

                    – Name of Variable: For the Variable name ‘Current date +/- ??? days’ the Indicator for I/E should be selected as ‘I’ and option as ‘EQ’

                    /wp-content/uploads/2015/08/img5_779340.jpg

                       
                 – Upon clicking ‘OK’, the next screen allows to enter the value for the Date Calculation Parameters.
                    Enter ‘-1’ here, since we need the previous day’s data.
                    /wp-content/uploads/2015/08/img6_779341.jpg
                    – The final screen will be as follows
                    /wp-content/uploads/2015/08/img7_779343.jpg
     5. Upon saving this, you will be re-directed to the Parameters screen, where the Date field will be auto populated with the previous day value
              /wp-content/uploads/2015/08/img9_779344.jpg

3. Define a Job to schedule the above report output as an email

     1. Go to System à Services à Jobs à Define Job
          /wp-content/uploads/2015/08/img10_779357.jpg
     2. Enter the Job Name and Job Class
          /wp-content/uploads/2015/08/img11_779358.jpg
     3. Go to Step. Here, enter the program name RSSHOWRABAX and the variant created above ZSHORT_DUMPS.
          In the user field, you can enter the User ID with which you want the email to be triggered.
          /wp-content/uploads/2015/08/img12_779359.jpg
          In our case, we needed it to be executed with ALEREMOTE. Click on Save.
               /wp-content/uploads/2015/08/img13_779362.jpg
     4. This step will send a mail to the SAP Business Workspace. In order to further forward this mail to the external email addresses, we will use the                         program RSCONN01 (SAPconnect: Start Send Process) and the variant SAP&CONNECTINT.
          /wp-content/uploads/2015/08/img14_779366.jpg
     5. Upon clicking Save, you can see both the steps in the overview.
          /wp-content/uploads/2015/08/img15_779367.jpg
     6. Next, enter the recipient details using the ‘Spool List Recipient’ Button. You can select from Internal User, Distribution lists and External addresses.
          /wp-content/uploads/2015/08/img16_779368.jpg
     7. Next, select your Start Condition to trigger this job. In our case, we have defined the same to trigger at the 1st second of the day daily.
          /wp-content/uploads/2015/08/img17_779372.jpg

5. Final Output

An email will be received daily at 12:00 AM, from ALEREMOTE. The Subject of the email will be as follows:
      Job <Job Name>, Step 1
          /wp-content/uploads/2015/08/img18_779373.jpg
The attachment will display the Runtime Errors information as shown below. This is the same information that we get in ST22.
      The below information is obtained in the mail triggered at 12:00 AM on 8/12/2015. Hence, it gives all the ABAP short dumps occurred on 8/11/2015.
     /wp-content/uploads/2015/08/img19_779374.jpg