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

writing custom code for enhancing the generic data source

Former Member
0 Likes
612

Hi,

I need to create a generic extractor from two main tables ( Header and detail) by creating the extractor based on a view of these two tables. However I also need to include information/fields ( both header as well as detail level) form a host of ther tables in the data source.

I would like to know where to find the the extractor program and/or user exit to write the custom code for populating the fields, after appending additional fields the append structure manually.

Also want to know whether the entire data source extended this way should be delta enabled?

If there are other ways to do this, example function module etc.. I would like to know.

Thanks in advance for the help and I would reward with appropriate points

Arunava

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Likes

Hi Siggy and AHP.

I have been able to write the function module extractor ( quite a complex on involving many tables, header, detail and other tables both at the header, detail level). I agree with Siggy, that in this case the FM option is the best one.

However I haven't tried the delta with this option and I really need most of the fields ( can come from any of the four tables mentioned above) to be anabled in delta.

When I go to do the generic delta, it only allow me to enable only one field. Does that mean that changes to only that field will trigger the delta extraction?

What about changes to the other fields?

Please let me know.,

Arunava

edwin_harpino
Active Contributor
0 Likes

hi Anurava,

try to force remove 'hide field'

tables ROOSFIELD.

Update ROOSFIELD set NOTEXREL = 'Y' where

OLTPSOURCE = '[datasource name]' and

FIELD = '[fieldname]' and objvers = 'A'.

if need to enable selection

Update ROOSFIELD set SELECTION = 'X' where

OLTPSOURCE = '[datasource name]' and

FIELD = '[fieldname]' and objvers = 'A'.

many fields for delta, you may need one new field,

and let's wait Siggi's reply

Former Member
0 Likes

Hi Arunava,

well you only need to have one field for the generic delta. This field will be passed to the fm. In the fm you can use it to select from different tables using different dates (creation date, change date). E.g. you defined a field ZDATE as THE generic delta field. Within the extractor you get that field in table

s_s_if-t_select. From there you put it into a range table or a fm-internal date field (defined as global or static). Then you do a select like this:

select * from header_table

where ( erdat >= g_zdate

or aedat >= g_zdate ).

select * from item_table

where ( erdat >= g_zdate

or aedat >= g_zdate ).

Additionally you can join header and item table to do the select or open a cursor ....

Check out /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module for some more information.

regards

Siggi

Former Member
0 Likes

Siggi,

This doesn't work for me, the system indicated error when I specify ZDATE for the generic delta. the system indicates that the field can only be selected from the 'Delta Specific Field ' Field nm F4 value, This only comes from the field of the data extractor structure.

As per your sugesstion it seemed that I can define my own field ( ZDATE) which need not be present in the extraction structure.

Thanks

Former Member
0 Likes

Hi,

As far as i understand, you will be able to define a 'zfield' in the FM only if you have the field already appended to the extract structure of the datasource. If not, the FM will not identify the field.

Regards

edwin_harpino
Active Contributor
0 Likes

hi Anurava,

create generic extraction, see

http://help.sap.com/saphelp_nw04/helpdata/en/3f/548c9ec754ee4d90188a4f108e0121/frameset.htm

the way we enhance generic datasource is just same as business content, enhancement RSAP0001 is used.

yes, it should be delta-enabled, check doc how to generic delta

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/84bf4d68-0601-0010-13b5-b06...

http://help.sap.com/saphelp_nw04/helpdata/en/37/4f3ca8b672a34082ab3085d3c22145/frameset.htm

generic extraction using function module, take a look Siggi's weblog

/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module

http://help.sap.com/saphelp_nw04/helpdata/en/86/1c8c3e94243446e10000000a114084/frameset.htm

sample code can see in RSAX_BIW_GET_DATA_SIMPLE

hope this helps.

Former Member
0 Likes

Hi Anurava,

so you already have to define a generic datasource. In this case I would recommend to go with a function module directly instead of using the table/view extraction and enhancing it via the exit.

regards

Siggi

Former Member
0 Likes

Hi,

I am having issues with making the appended field visible in the data source.

Here is what I have done

1> using tran 'Maintain generic data source' I have created a data source from a view and after that I have appended another striucture ( containing some fields) into the extraction structure of the data source and activated both.

But when I return to the data source, those fields are always greed out.

Please let me know the step by step procedure to enable those( uncheck the hide checkbox)

edwin_harpino
Active Contributor
0 Likes

hi Anurava,

to uncheck the hidden checkbox for these new added fields,

transaction rso2, type in your generic datasource, click 'edit', in next screen, you need to click 'save', it will bring you to datasource edit, here scroll the screen down, you will see the new fields in last rows, remove 'hide field' checkmark for these fields.

and click 'save' again.

hope this helps.

Former Member
0 Likes

Hi AHP,

That is the issue.

when I do rso2> change> save ... only the fields that the view contains appear for the selection. However the field enhancement that I have done with the extract structure never appears. However if instead of 'Save' If I select the 'Display Field list (F7)' It should show the appended fields but in this case it would all be greyed out and I won't be able to 'Unhide' those fields.

This is a peculiar situation, Please help.

Thanks

Arunava

Former Member
0 Likes

Siggy,

Can you please send me a step by step procedue of creating a generic extractor out of a header and detail table( Please note that I need an extractor for not only combining the header and detail fields but a lot of other table both at the header as well as detail table lever. Also please let me know whether all the fields should be delta enabled for the extractor, irrectpective of which table the field is coming from.

In the generic extractor for the view method, I find only one field in the entire extractor can be delta enabled. This, I think is a mazor limitation.

Thanks

Arunava

Former Member
0 Likes

Hi dear,

about delta enabling of your datasource, you have to activate it on RSO2 (as "generic delta": you can find a lot of useful info in previous posts about this topic!).

About enhancement to fill additional fields, you have to follow the same procedure as per standard datasource: after adding them into an append, you have to use CMOD and include RSAP0001 enhancement and userexit EXIT_SAPLRSAP_001 for transactional data...(you can find a lot of info for this topic too!)

Hope it helps!

Bye,

Roberto