cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Data from BSEG matching custom table..

Former Member
0 Likes
1,653

Hi Friends,

I got a little tricky requirement.


Client has got 2 custom tables which holds the document number and the unique ID (UID).

Now I am expected to get the amount data relevant to this from BSEG.

Flow -> Get the doc number from 2nd custom table based on some keys in 1st custom table. Then pass on this to BSEG to get the data using doc number.

Am not clear if its related to Gl, AP or AR...yet. All I am aware is to get the amounts data from BSEG, as per the requirement.

Am thinking of below solutions:

  • Use the standard extractor (0FI_GL_04 alone?) which gets the data from BSEG and BKPF (Read from other posts). Enhance this with the unique Key (UID). Build this into a DSO. Build the DSOs on other 2 custom tables (Transparent) ones (Generic DS), and do a look up on these in the DSO of 0FI_GL_04 to get the amounts for the UID. Not sure about this approach though
  • Go for the View on req fields in BKPF/BSEG with join on key fields, create a generic DS. Load this to the DSO, and then look up the other 2 custom table DSOs? Is a view possible on BKPF/BSEG (BSEG being cluster table - Read from other posts that it is possible?)
  • Build a FM based extractor for all the 3 tables in source? Guess this might be complicated? Am not familiar with this. View is not possible on join of these 3 as there is no key field common in BSEG to the custom tables.

Please suggest on solutions as I really need your help in pros and cons or any other better alternatives for this

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Likes

Hi all,

Please suggest on the below points:

FM usage from a performance aspect as I need to read from BSEG table?

How about the standard DS enhancement of 0FI_GL_4 with the unique ID? Isn't it a good alternative except for the Daily delta limit? Also, guess it is not mandatory for me to use the 0FI_AP_4 and 0FI_AR_4 ones as well?

Because the base tables BKPF/BSEG get updated in the end even from AP/AR postings. In that case whats the use of AP/AR extractors? Am little confused in this. GL extractor only pulls the GL data? Please help me understand what this means.

If I have to go with a FM only, should I use RSAX_BIW_GET_DATA_SIMPLE (FULL) or RSAX_BIW_GET_DATA (DELTA) ?  But I seen many posts in forums using RSAX_BIW_GET_DATA_SIMPLE for delta? Please clarify which to use?

Also seen this one -> RSVD_BW_GET_DELTA_DATA?

KamalMehta
Product and Topic Expert
Product and Topic Expert
0 Likes

You have to use RSAX_BIW_GET_DATA_SIMPLE . You need to copy it into new Function Module.

You have to write the logic and you have to enabale the delta in order to make it work.

Have you gone throw the link that i have suggested. You would get all the details.

Thanks

Former Member
0 Likes

Please suggest on the FM from a performance aspect as I need to read from BSEG table.

This was the table suggested to me as per the requirement.

How about the standard DS enhancement of 0FI_GL_4 with the unique ID? Isn't it a good alternative except for the Daily delta limit? Also, is it mandatory for me to use the 0FI_AP_4 and 0FI_AR_4 ones as well?

Because, read some where that the base tables BKPF/BSEG get updated in the end even from AP/AR postings. In that case whats the use of AP/AR extractors? Am little confused in this. GL extractor only pulls the GL data? Please help me understand what this means.

If I have to go with a FM only, should I use RSAX_BIW_GET_DATA_SIMPLE or RSAX_BIW_GET_DATA?

Heard RSAX_BIW_GET_DATA_SIMPLE is for FULL only and RSAX_BIW_GET_DATA is for Delta?

But I seen many posts in forums using RSAX_BIW_GET_DATA_SIMPLE for delta? Please clarify which to use?

There is one more mentioning the above pattern FMs doesn't suffice? RSVD_BW_GET_DELTA_DATA?

Former Member
0 Likes

Please help in the same

KamalMehta
Product and Topic Expert
Product and Topic Expert
0 Likes

Have you check the link provided by me. I have given the complete code over there.

Please check it you would get the idea.

Thanks

Former Member
0 Likes

Hi Kamal,

Yes I did. But I need to get it from the cluster BSEG for a document number coming from a custom table.

Any advice on the performance?

Former Member
0 Likes

Aditya,

View is not possible since it is a cluster table.

You go with FM , be sure in Delta pointer alone.

Regards,

Venkatesh

KamalMehta
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Aditya ,

From my point of view  you have to achieve this with the help of Generic extractor using FM.

1. Your document numbers are already there in your custom tables now you need to check for some field in this table only to identify the document number getting changed/created during that period.

2. Once you get these document numbers you can select the relevant data from BSEG/BKPF in the select statement in the Open cursor statement in the FM Source code .

Also please refer http://scn.sap.com/message/14307484 .

This is relevant and you also have some code for your reference.

Your other 2 approaches doesn't look feasible to me .

Thanks

Former Member
0 Likes

Thanks Kamal.

Will check that link.

Please check my latest response and suggest

freek_cavens2
Participant
0 Likes

Hi Aditya,

Your second option will not be possible.  Bseg is a clustered table and as such cannot be used in a view.

The first option is not recommended, as you would load quite a lot of data in BI, that you would not be using.  It's also possible that you would have issues with the timings of both loads : all records should exist in the lookup table at the time of the load of the custom tables.  You would have to be careful about this.

I would go for the third option : create a custom datasource using RSO2, based on a function.  You will need to write the extractor function yourself (or ask an abap developer).  You can find examples of how to do this in function group RSAX (only the simple interface function is possible).  You need to keep to the structure of the function, but for the rest it's just simple ABAP coding.  It will also be the best solution for performance, as you can write the code for mass processing.

See the following post for documentation about writing an FM:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8d...

You can make it delta enabled, but you will need to get the delta pointer by code from the ROOSGENDLM table.  If you need more info of this, let me know and I will provide you with sample code.

Regards,

Freek

Former Member
0 Likes

Hi Freek,

Never really done this. Thanks for the suggestion.

Please let me know more info regarding the 3rd option.

But regarding 1st option, am confused reg more data...?

freek_cavens2
Participant
0 Likes

Hi Aditya,

If you want to use option nr 3, writing your own function, there is not much more info that I can give than you can find in the documentation in my previous post.

The reply from Kamal also contains a very interesting link about delta management.  For the rest, it's just about writing ABAP within the structure of the function.

About option 1 : if you do not already have the FI line item data from 0FI_GL_4, then you would need to load it in BW especially for this purpose.  If you want to use this data to read extra information during your custom load, you have to be sure that all required data is loaded using the 0FI_GL_4 datasource at the time you are loading your custom data.  With delta managed datasources, this is not always the case, because the loads are never done on exactly the same time.  Therefor you could end up with missing data.

Regards,

Freek

Former Member
0 Likes

Hi Freek,

Am just worried about the performance issues if I read from BSEG since its a cluster table.

If I go ahead with the FM on the 2 custom tables and BSEG, it might suffice the requirement but how about the Delta? Am not sure as the full load will be lot of issues from a performance and content aspect.

Any sample and efficient way to make such FM? Please suggest

freek_cavens2
Participant
0 Likes

Hi Aditya,

The question for the delta will be : what is the starting point of the data selection?  Is it one of your two custom tables or is it the BSEG table?  I presume it is one of the custom tables.  If so, you have to options to create a delta in an extractor function :

  • You can create a delta on a date/timestamp : this means that a field should be available in your custom tables that you can use for your purpose.  In that case you would end up with something like this (an extractor, delta based, for material documents, see attachment extractor_delta_timestamp.txt)

  • You can add entries to a delta table (when you update your custom tables, you can also add them to a table that keeps track of the delta).  In this case, you must write your own logic to maintain the delta table and also give the update mode as a parameter in the extract structure (and Infopackage).  That would lead to something like this : a delta based text extractor for 0MAT_PLANT, that reads a delta table that is maintained based on the daily transactions. (, see attachment extractor_delta_tablebased.txt).

Based on the data you have available, you will have to choose between the two options.  Option 1 is easier, because it uses the standard BW delta mechanism, but option 2 gives more flexibility (though also more complexity).

Regards,

Freek

Former Member
0 Likes

Thanks Freek. But unable to view these files as it gives some wrapped data.

Whats the format

 

The delta field must be from the custom tables itself. How about the below approach, instead of an FM?

Install and load of FI_GL_4 and do a look up on this in the Level 2 DSO which comes from the 2 custom tables?

Cons would be the high data load and a delta limit of the timestamp.

Can I also use only AP/AR instead of this DS, incase I don't need GL.

freek_cavens2
Participant
0 Likes

Hi Aditya,

It seems the SCN has zipped the files.  You will have to unzip them.

The lookup on the FI_GL_4 DSO is possible, but you will have to be carefull with the delta.  If you do the lookup and the data is not in de FI_GL_4 DSO yet, then you might not get it again the next day and as such create orphans.

If you do not need GL, it would probably be wiser to use AR/AP.  This contains a lot less data and as such will be much faster.  The select will be a little more tricky though, as the data is split over 4 tables, Open and closed for AR and AP. (BSIK, BSAK, BSID, BSAD).  This means that you would have to create four sequential cursors to get all the data.  By sequential, I mean : Open cursor for the first table, read all the data, close the cursor and open the next.  And this all split over different packages.  It's not that difficult, but if you're not at home in ABAP development, this may be a challenge.

Regards,

Freek