Quantcast
Channel: SCN : All Content - All Communities
Viewing all 7999 articles
Browse latest View live

Manually Implemented lock for concurrency control @ XS application layer

$
0
0

User CRUD operations is very common during the HANA XS application development process.

And let's have a try and discovery on the concurrency control and the lock mechanism design.

 

1.Assumed use case.

In the assumed scenario:

The database table has 4 fields, DATE,PERSON_ID,NAME and PERSON_INFO.

DATE and PERSON_ID make the primary key.

 

Here is two pages in the application:

The page shows the content exposed from HANA database.

And you could click on the "Edit Content" button in the head of the table.

 

Edit.JPG

 

The designed scenario is "Multiple users cannot edit the same record at the same time period".

For example, while user1 is editing content of PersonID 1001 on DATE '2015-02-09', user2 cannot edit PersonID 1001 on '2015-02-09' but user2 is allowed to edit PersonID 1001 on '2015-02-10' or PersonID 1002 on '2015-02-09'.

 

If no confilcts happens, user would be directed to this page, then do the save or cancel operations.

save.jpg

editable.jpg

 

If someone is editing, the page would give an alert:

 

tryagian.jpg

 

 

2.Business requirement analysis

 

Here I draw a very simple business requirment process flow diagram for better understanding.

 

BPM.JPG

 

 

There is some point need to be noticed:

(1)     When user click on the "edit" button, the application should decide whether it should be directed to the next page or alert a notice that other user is editing the same record.

(2)     For situation when user forget to terminal the session, the system should have a default time-out mechnism and release the lock.

 

3.technical design

 

I came up an idea which is writing all the users' opertions down and maintaining the opertion log in a trasaction table.

When user click on the "edit" button, the service would check the transaction log first and then decide whether the user could enter the next page.

 

Lock Table design:

table_design.jpg

 

This table has four fields, firstly it should contain the primary key as the database table has.

Then the LOCK_TIMESTAMP is used for tracking the time when the click event session starts.

The SESSSION_USER is used for taking notes of the operator of this session.

Beacuse this table is used for OLTP scenarios and it always to be fetched or looked up by record, so row store is a better choice.

 

Here is the enhanced process flow:

BPM2.JPG

 

 

Whenever the user click on the "Edit" button, the service would first look up the transaction table:

Three situations would cover:

(1)     If no log exist for this record, then add a new log for this record. Return yes to the user and let him/her view the next page.

(2)     If log exist, check the difference of the timestamp:

          (a)     Timestamp difference is larger than the value we set, overwrite the log  with current timestamp, return yes.

          (b)     Timestamp difference is smaller than the value we set, keep the log  same, return no and the session_user value, then alert a message to                               the user and tell him/her someone is editing the records.

 

4. implement and show the code

 

Let's have a look at the code:

I use XSJS service to implement this:

 

function EditRecord(){

    var PersonID= $.request.parameters.get('PersonID');             //Get the PersonID which user inputs

    var Date= $.request.parameters.get('Date');                         //Get the Date which user inputs

    var diffTime;                                                         //Store the value for differnce between current timestamp and the timestamp value in the transaction table

    var username;                                                     //Store the lock user name in the transaction table

    var conn=$.db.getConnection();

    var pstmt;

    var query ="select seconds_between(time_lock,CURRENT_TIMESTAMP),DATE,SESSION_USER from \"XXX\".\"LOG_FOR_LOCK\" where PERSON_ID= ?";

    pstmt=conn.prepareStatement(query);

    pstmt.setString(1,PersonID)

    var rs=pstmt.executeQuery();

    while(rs.next()){

        diffTime=rs.getInteger(1);

        LockTableDate=rs.getDate(2);

        username=rs.getString(3);

        if(Date.getTime()-LockTableTime.getTime() ==0 && diffTime<1200 && username!==$.session.getUsername())

        {$.response.setBody(-1);return -1;}

    }

     // We check whether the DATE are the same by using the getTime() function. And I set the time-out value to be 1200 seconds.

     // Also, here we allow the same user to open multiple sessions. Otherwise, it is possible to let the user be locked by himself.

 

     // if the function does not end, which means whether there is no log for the records or the log is out-dated.

     // So we should insert or update the log information with the current session

 

    var query1="upsert \"XXX\".\"LOG_FOR_LOCK\" values('"+ Date + "','" + PERSON_ID +

    "',now(),'"+ $.session.getUsername()+ "') where DATE= " + DATE + " and PERSON_ID= " + PersonID ;

    pstmt=conn.prepareStatement(query1);

    pstmt.execute();

    pstmt.close();

    conn.commit();

    conn.close();

    $.response.setBody(1);

    return 1;

}

 

// When the application page call this service, it could decide whether jump to the next page according to the return value.

// I wrote this code just for test use, no gurantee for 100% secure or accurate.

 

 

5. Summary & FAQ

Absolutely, there is no best solution for every scenario.

This lock mechanism is designed for only some kind of situation and it may contain some defects.

I just implement for a test use case and the code I wrote may contain some flaws and it is not an official recommanded mechism.

Different methods would effects according to different design.

 

 

FAQ:

1.     How about orphan lock situation?

The service would check the timestamp between current timestamp and the timestamp stored in the log_for_lock table.

 

2.   What is the most siginificant difference between this application lock and database concurrency controll.

As my understanding, this application is meant to detect confilct when user click on the "edlt" button.

And database concurrenct controll is a lock mechism effect when comit action happens.

 

For other methods, please refer to below links for detailed information:

1.eTag:

http://scn.sap.com/community/developer-center/hana/blog/2014/12/02/sap-hana-sps-09-new-developer-features-new-xsodata-features

http://www.odata.org/documentation/odata-version-2-0/operations/#ConcurrencycontrolandETags

 

2. Optimistic Lock:

Just Google it and it would bring many good results.

 

3. HANA MVCC controll:

SAP HANA Concurrency Control

 

Special thanks for help from Thomas, Neil, Yuan and Antonie.

 

Please feel free to point out if there is any other flaw in this design and have discusion with me.

Thanks for reading.

Have a nice day.

 

Kevin


problems in ESS travel management

$
0
0

hi there,

 

we are having a Problem when creating travel requests and travel expenses in ESS (web dynpro abap) in Portal:

 

sometimes users have a reduced Input area, see screenshot. at the right side the user can scroll up and down there, but the area keeps that small.

 

This Problem occurs when users have an tablet as device. But from time to time it also appears on "normal" Desktop PC's.

 

any ideas ?

 

br Martin

 

Unbenannt.png

Selecting the hostname of the server from the CMS-Database

$
0
0

Hi, in the assumption the hostname (as can be found in the properties of the CMS-Server) is stored somewhere in the BI 4.x CMS-Database, does somebody know which SELECT-statement in Query Builder can be used to retrieve it ? I searched everywhere but I could not find it Many thanks, Eddy

getting error while creating fiori project

$
0
0

how to solve

fioriError.PNG

please reply ASAP

 

Thanks & Regards,

Navin Saran

F-32/FB1D - How to reverse check which Invoices were cleared?

$
0
0

Hi everyone,

 

I have following query:

When I post a document using F-32, say document XYZ is posted/generated.

Now when I check XYZ using FB03, can I find which Invoices were cleared using F-32?

 

(I tried going to General Ledger View and find the Invoices but could not find it)

 

In addition to that, if I reverse the same document XYZ then can I still find which invoices were cleared using F-32 during that transaction?

 

Please guide!

 

Thank you for your kind guidance!

 

Warm regards!

Design Studio 1.4 in SAP Learning Hub

$
0
0

Going to training.sap.com and accessing the SAP Learning Hub, I noticed SAP is offering an online course titled "SAP Business Objects Design Studio 1.4: Learning Map for Application Consultant"

 

What is good about this is it reminded me of the new custom data source SDK:

1figlh.png

Figure: 1: Source: SAP

 

The installation of this sample SDK is described in the SAP Help: http://help.sap.com/businessobject/product_guides/AAD14/en/ds14SP01_dev_guide_en.pdf

2fig.png

Figure 2

 

After installing it, it is a simple right click to add the custom data source (in this case, a .CSV)

3funnel.png

Figure 3

 

For fun I installed the Visual BI trial SDK extensions (see http://www.visualbi.com/DSXTrial ) and used the .CSV file I received from Robert Russell, when trying out his Lumira extensions.  Figure 3 shows a funnel chart of Japan footy scores, with Tokyo being the highest at the top.

4print.png

Figure 4

 

Figure 4 shows some of the features of the Visual BI extension, including printing or downloading a PDF or image.

 

The limitation of the CSV data source is you can't select data selection on measures. Of course, this is covered in the Learning Hub course as shown below:

5fig.png

Figure 5: Source: SAP

 

Figure 5 covers some limitations of the custom data source.  In the past I have heard that developers wanted to prototype offline and this is an option.

 

For more information about the Learning Hub, go to Getting access & accessing SAP Learning Hub #SAPEducation

Standard report to display materials along with allocations and type of allocations

$
0
0


Hi Gurus,

 

 

 

I have to look manually for several items one at a time to check for allocations against the item in MD04 screen. I am wondering if there is a report that could generate showing the material along with allocations against that item and the type of allocation.  For example, see the data below.



  

Material              Allocation           Type of Allocation



abcd                1234                       DepReq

 

 

Kindly help me in finding some standard report to fulfil my criteria. Thanks in advance

 

 

 

Regards,

 

Anurag

BI Launchpad – Platform Search

$
0
0


How can we customize the platform search functionality in BI Launchpad? I think the options in CMC are limited.

 

I have read the section about Platform Search in the administrator guide but am looking for a more advanced and in depth guide about how to configure Platform search (if possible).

We would like to configure facets, automatic suggestions,  the amount of reports displayed in top search-bar, search syntax, layout, etc.


We are running BI 4.1 SP4


What is the requirement to SAP for ESS and MSS

$
0
0

We would like to implement ESS and MSS.

Currently our SAP version is ECC6.0.

Do we need to upgrade it to implement ESS and MSS?

BTW, currently we store emergency details in IT21, and the contact number in the "Birthplace" field in IT21.

Some consultants said it will cause problem for ESS and MSS. However, we are not sure what kind of bad impact there is on ESS and MSS.

Do we have to change it before we implement ESS and MSS?

 

Looking forward to your reply and advice.

 

Thanks very much.

 

Di

SAP Forum Brazil 2015 (Mar 17-18) Sessions - coming soon

$
0
0
ScheduleSiteSessionDuration

Mar 17

10:30 - 11:00

Partner Lounge

Sala GPO

Como certificar o seu produto com SAP

utilizando ABAP e HANA

30 min

Mar 17

11:00 - 11:30

Partner Lounge

Sala GPO

Como certificar seu produto com a SAP

utilizando Hybris

30 min

Mar 17

14:30 - 15:00

Partner Lounge

Sala GPO

Como integrar e certificar seu produto com a SAP

utilizando SAP Fiori

30 min

Mar 18

11:30 - 12:00

Partner Lounge

Sala GPO

SAP Business One

Explorando o Roteiro para Certificação

30 min

Mar 18

14:30 - 15:00

Partner Lounge

Sala Walldorf

SAP Tax Declaration Framework

Oportunidades de Integração e Certificação

30 min

Mar 18

15:00 - 15:30

Partner Lounge

Sala Walldorf

Plataforma SAP HANA

Explorando o Roteiro para Certificação

30 min

Mar 18

15:30 - 16:00

Partner Lounge

Sala GPO

Cloud

Oportunidades de Integração e Certificação

30 min

Mar 18

17:40 - 18:10

Campus Tecnologia

e Plataforma

Mobile e User Experience

Como integrar e certificar um mobile app com a SAP

SMP e Gateway

30 min

Synchronization Tool notes and updates - TaxFactory 10

$
0
0

Hello Community,

 

Please, refer to the all notes related to the new Sync tool:

 

2139409 The system does not have the required TUB installed

2130013 BSI: Sync Payroll Tax Data - Synchronization Errors

2127736 BSI: allow Sync. Payroll Tax Data to process tax authority mappings only

2125327 BSI: Sync Payroll Tax Data generates a short dump when BSI version is not speci

2116032 BSI: Improvements in Synchronize Payroll Tax Data tool

2101719 BSI: Sync. Payroll Tax Data dependencies on BSI Tax Type mappings

2082725 BSI: Synchronize Payroll Tax Data - FAQ

2069358 BSI: Corrections in Synchronize Payroll Tax Data report

2064814 BSI: Hide transport pushbuttons of the Synchronize Payroll Tax Data report

2058977 BSI: Sync. Tax Data does not save new tax authorities in transport

2052438 BSI: Sync. Payroll Tax Data generates invalid entries in T5UTD

2046535 BSI: Sync Payroll Tax Data displays error message when running in productive mo

2043697 BSI: Sync. Payroll Tax Data generates a short dump when running in productive m

2041033 BSI: Authorization checks for HRPAYUS_SYNC_TAX_DT

2009438 BSI: Sync.Payroll Tax Data shows error message - New authority was not inserted

1992697 BSI: Sync. Payroll Tax Data is generating duplicated tax authorities

1992315 BSI: Required TUB level for Synchronize Payroll Tax Data tool

1984911 BSI: Synchronize Payroll Tax Data - General Corrections

1975742 BSI: Synchronize Payroll Tax Data

 

For further documentation access:
service.sap.com/hrusa

  • ASUG Webcast: HCM US BSI Timelines and Updates (February 19, 2015)On February 19, 2015, SAP gave a presentation that covered upcoming BSI timelines, review of the new Synchronize Payroll Tax Data tool, and updates about recently released Year End changes. For more information, see the presentation slides.


  • ASUG Webcast: HCM US Payroll - TUB Workbench, A Tool To Apply TUBs (March 17, 2014) On March 17, 2014, SAP presented a new tool (Synchronize Payroll Tax Data) which will replace the current process of Tax Update Bulletin (TUBs) in the future. For more information, refer to the presentation slides. SAP will also release an FAQ Note about this topic in the near future.



Thank you,


Kind regards,


Graziela Dondoni









How to bring zooming functionality for InkPicture conrol in a form

$
0
0

Hi,

In powerbuilder 11.2

 

How to bring zooming functionality for the ink picture control . When the user selected desired % layout , the control should be zoomed as per the layout selected by the user.

 

Kind Regards

Pol

BSI Tax Factory 10.0

$
0
0


Hello community,

If you have questions about TF 10.0, you can post this on this thread. We will update this thread with tips and notes related to Tax factory 10.0.

 

Thank you,

 

Kind regards,

 

Graziela Dondoni

PHP SoapClient LoginService.wsdl Invalid document structure

$
0
0

Hello,

 

I am struggling with B1WS-Soap. This is my Code:

 

<?php

error_reporting(E_ALL);

 

try {

    $client = new SoapClient("http://192.168.80.3/B1WS/WebReferences/LoginService.wsdl", array('trace' => 1,'soap_version' => SOAP_1_2));

  $options = array(

    'DatabaseServer' => '192.168.81.4',

    'DatabaseName' => 'SBODEMODE',

    'DatabaseType' => 'dst_MSSQL2012',

    'CompanyUsername' => 'manager',

    'CompanyPassword' => 'secret',

    'Language' => 'ln_German',

    'LicenseServer' => '192.168.81.3:30000',

  );

 

  $something = $client->Login($options);

  var_dump($something);

}catch (Exception $e) {

    echo "<pre>";

    print_r($e);

}

 

?>

 

 

 

This is the error:

SoapFault Object ( [message:protected] =&amp;gt; Invalid XML [string:Excepti - Pastebin.com

 

Somewhere I read there could be encoding issues... Can someone post demo-code? Thanks.

SPED ECD Bloco J100 Campo IND_DC_BAL_INI

$
0
0

Boa tarde a todos.

 

Alguém poderia me ajudar com o seguinte caso.

 

Estou corrigindo alguns erros na emissão do arquivo SPED ECD, mas não consegui encontrar uma solução para este caso.

Nos registros do bloco J100, quando constam saldo 0,00, o campo que define a chave de lançamento sai em branco.

 

Alguém poderia me ajudar com este caso?

 

Obrigado.


XML file to XML interface for SNC

$
0
0

Hi PI experts,

 

 

 

I'm working on a custom interface for SNC where in I need to create an interface which will pick up an  XML file for ASN and then pass it to the standard ASN interface in SNC(inbound) i.e."DespatchedDeliveryNotification_In".

 

 

I'm a beginner in PI so I would like to know if I need to map the standard SNC inbound ASN interface(target) to the incoming XML file structure,what is the first step in doing the mapping?

 

 

I already have the receiver and sender systems configured so I just need to create the "message mapping" from scratch to build this interface.

 

 

Can soemone please provide some pointers as to hwo should I get started with the creation of interface.

 

 

My main query is how to create a the source structure(for incoming XML file which I alreay have with me) to map to the std ASN XML interface?

 

 

Are there any tools in PI which can be used to create the structures to be used in mapping?

 

Any inputs are highly appreciated.

 

Thanks.

 

BR,

AD

Instalação NF-e 3.10

$
0
0

Bom dia Pessoal,

 

Todos já instalaram a NF-e 3.10?

Qual a complexidade da instalação? É só uma atualização?

 

 

Danielle

SAP Persona 2.0:Need to Copy status Message Dynamically

$
0
0

Hi All,

   i have a requirement to display status message separately beside a text box component.I tried using the script button,But the status dynamically changes for each and every input we are giving.

 

Is there any process(script/Method) to update the label dynamically according to the change in the status.

One single interface for two receiver systems with different target structure

$
0
0

Hi experts,

 

I have a custom interface which converts incoming XML file to ASN IDOC in ECC.

 

Now using the same source XML file depending on the value of one of the fields in the source XML file,I need to create an XML message in another system(SNC) for the same document(ASN).

 

Can someone please provide me some pointers/steps as to how this is possible...Multi-mapping?Multiple receiver determination?

 

Thanks.

Project upload - SAP PPM

$
0
0

Hi,

       We are trying to upload projects from MS excel to PPM and are using the program DPR_DX_PROJECT. The log says that the project structure has been created but we do not see the project created in the database. We have also applied the note 1876370. Could someone let us know what could be the problem?

 

thanks.

Viewing all 7999 articles
Browse latest View live




Latest Images