Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ABAP CODE TO POPULATE LOGICAL SOURCE SYSTEM

Former Member
0 Likes
2,755

Hi Friends please help me with the below

1. Requirement : to Populate The system Date , Source System

in BI for Each load request.

1 Solution: I thought of writing the Start Routine for this but it is giving me error

syntax Error: END METHOD MISSING?????

2. Also I have requirement to populate 0sourcsys source system id, can any body help how to populate that.

Thanks

Poonam Roy

ABAP Code.

I have the End Method. what more to do.

METHOD start_routine.

*=== Segments ===

FIELD-SYMBOLS:

<SOURCE_FIELDS> TYPE tys_SC_1.

DATA:

MONITOR_REC TYPE rstmonitor.

$$ begin of routine - insert your code only below this line -

... "insert your code here

FORM STARTROUTINE

USING G_S_MINFO TYPE RSSM_S_MINFO

CHANGING DATAPAK type TRANSTRU

ABORT LIKE SY-SUBRC.

DATA: ZLOAD_DAT LIKE SY-DATUM

ZZSOURSYS TYPE RSLOGSYS

IF G_S_MINFO-DATAPAKID=1

SOURCE_FIELDS-ZLOAD_DAT = SY-DATE.

SOURCE_FIELDS-ZZSOURSYS = G_S_MINFO-LOGSYS.

ENDIF.

ABORT = 0.

ENDFORM.

ENDMETHOD.

ENDCLASS.

*-- fill table "MONITOR" with values of structure "MONITOR_REC"

*- to make monitor entries

... "to cancel the update process

  • raise exception type CX_RSROUT_ABORT.

$$ end of routine - insert your code only before this line -

ENDMETHOD.

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,716

You have to write the code (<b>in BI/BW</b>) in the transfer rule (<b>between Datasource transfer structure and infosource/info object</b>)

There the FORM begin with

[code]USING RECORD_NO LIKE SY-TABIX

TRAN_STRUCTURE TYPE TRANSFER_STRUCTURE

G_S_MINFO TYPE RSSM_S_MINFO

CHANGING RESULT TYPE /BI0/OIPERSON

G_T_ERRORLOG TYPE rssm_t_errorlog_int

RETURNCODE LIKE SY-SUBRC

ABORT LIKE SY-SUBRC. “set ABORT <> 0 to cancel datapackag[/code]

GS_MIN_INFO structure RSSM_S_MINFO contains information on the request being processed.

<i>G_S_MINFO. This passes technical information about the data load request,

such as requesting user, request date and time, update mode, the handling of

duplicate records, error handling flags, parallel processing flags, and what data

targets to update.</i>

If tou want to use start-routine for optimization reasons and fill an empty field in transfer structure, the structure G_S_MINFO is available too.

[code]USING G_S_MINFO TYPE RSSM_S_MINFO

CHANGING DATAPAK type TAB_TRANSTRU

G_T_ERRORLOG TYPE rssm_t_errorlog_int

ABORT LIKE SY-SUBRC. “set ABORT <> 0 to cancel datapackage[/code]

And stay in FORM between limits :

[code]$$ begin of routine

$$ end of routine[/code]

Update RESULT in first case, and field(s) of DATAPAK in second case.

[code]RESULT = G_S_MINFO-LOGSYS.[/code] or

[code]LOOP AT DATAPAK INTO l_s_datapak_line.

l_s_datapak_line-zzsourcsys = G_S_MINFO-LOGSYS.

MODIFY DATAPAK FROM l_s_datapak_line.

ENDLOOP.[/code]

Regards

11 REPLIES 11
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,716

Just fill Infoobject with routine in transfer rules. This will leave Datasource and Stransfer structure unchanged.

Fill return with sy-datum/sy-datlo, G_S_MINFO-LOGSYS.

For source ID, use following FM

CALL FUNCTION 'RSDG_ID_GET_FROM_LOGSYS'
EXPORTING
i_source_system = G_S_MINFO-LOGSYS
IMPORTING
e_soursysid = RESULT
EXCEPTIONS
id_not_found = 1.

Regards

Read only

0 Likes
1,716

Thanks A million for the response. i got success with system date in transformation but please correct my source system id code. it is giving me error

my BI object name is ZZSOURSYS.

Where should i put the code in routine transformation for ZZSOURSYS or in data soource enhancement in cmod where. please help

i got this error in routine transformation

Error: E:Field "G_S_MINFO-LOGSYS" is unknown, it niether one of the data statement so when i use data it gives error saying characters like - 0 not allowed

Thanks

Poonam

Please help

DATA: G_S_MINFO-LOGSYS.

CALL FUNCTION 'RSDG_ID_GET_FROM_LOGSYS'

EXPORTING

i_source_system = G_S_MINFO-LOGSYS.

IMPORTING

e_soursysid = RESULT.

EXCEPTIONS

id_not_found = 1.

null

Read only

0 Likes
1,716

First, Have you assigned a Source System ID in RSA1, Tools Menu, Assignment of Source System to Source System ID.

Logical source system G_S_MINFO-LOG is one of the parameters provided when you build a routine in <b>transfer rules</b> (in BI)

Regards

Read only

0 Likes
1,716

Requirement is to have the sourcesystem id's. I have assigned the source system id's to logical source system in rsa1 but still it is giving me same error that G_S_MINFO NOT defined so to resolve that i changed the code as below

But Now it is giving me dump error during loading but no syntax error.

please help me

thanks

Poonam

<b>Abap Code in routine one to one .</b>

TYPE-POOLS: RSSM.

Data: G_S_MINFO TYPE RSSM_S_MINFO.

CALL FUNCTION 'RSDG_ID_GET_FROM_LOGSYS'

EXPORTING

i_source_system = G_S_MINFO-LOGSYS

IMPORTING

e_soursysid = RESULT

EXCEPTIONS

id_not_found = 1.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,717

You have to write the code (<b>in BI/BW</b>) in the transfer rule (<b>between Datasource transfer structure and infosource/info object</b>)

There the FORM begin with

[code]USING RECORD_NO LIKE SY-TABIX

TRAN_STRUCTURE TYPE TRANSFER_STRUCTURE

G_S_MINFO TYPE RSSM_S_MINFO

CHANGING RESULT TYPE /BI0/OIPERSON

G_T_ERRORLOG TYPE rssm_t_errorlog_int

RETURNCODE LIKE SY-SUBRC

ABORT LIKE SY-SUBRC. “set ABORT <> 0 to cancel datapackag[/code]

GS_MIN_INFO structure RSSM_S_MINFO contains information on the request being processed.

<i>G_S_MINFO. This passes technical information about the data load request,

such as requesting user, request date and time, update mode, the handling of

duplicate records, error handling flags, parallel processing flags, and what data

targets to update.</i>

If tou want to use start-routine for optimization reasons and fill an empty field in transfer structure, the structure G_S_MINFO is available too.

[code]USING G_S_MINFO TYPE RSSM_S_MINFO

CHANGING DATAPAK type TAB_TRANSTRU

G_T_ERRORLOG TYPE rssm_t_errorlog_int

ABORT LIKE SY-SUBRC. “set ABORT <> 0 to cancel datapackage[/code]

And stay in FORM between limits :

[code]$$ begin of routine

$$ end of routine[/code]

Update RESULT in first case, and field(s) of DATAPAK in second case.

[code]RESULT = G_S_MINFO-LOGSYS.[/code] or

[code]LOOP AT DATAPAK INTO l_s_datapak_line.

l_s_datapak_line-zzsourcsys = G_S_MINFO-LOGSYS.

MODIFY DATAPAK FROM l_s_datapak_line.

ENDLOOP.[/code]

Regards

Read only

0 Likes
1,716

You don't have to define G_S_MINFO. It is defined in the FORM to use.

So where are you inserting your code?

Regards

Read only

0 Likes
1,716

Hi Raymond , please help me, i am writing the code in one to one mapping in transformation routine in BI 7,0 right click on zzsourcsys and go tp rule details

then can you modify my code and i can use that .

TYPE-POOLS: RSSM.

Data: G_S_MINFO TYPE RSSM_S_MINFO.

CALL FUNCTION 'RSDG_ID_GET_FROM_LOGSYS'

EXPORTING

i_source_system = G_S_MINFO-LOGSYS

IMPORTING

e_soursysid = RESULT

EXCEPTIONS

id_not_found = 1.

if i write your code in start routine it gives me error saying end method missing

thanks

Poonam

Read only

0 Likes
1,716

Hi Raymond, so kind of you,

please help me, i have written the code in one to one mapping in transformation routine in BI 7,0 right click on zzsourcsys and go tp rule details. No syntax errors in the code but when i load there is no value populating to zzsourcsys . i have defined zzsourcsys as 12 char. can u suggest where it is going wrong, i checked in tools assignment of sourcesystem id is there in my system.

Abap Code

TYPE-POOLS: RSSM.

Data: G_S_MINFO TYPE RSSM_S_MINFO.

RESULT = G_S_MINFO-LOGSYS.

Thanks

Poonam Roy

Read only

0 Likes
1,716

Hi Raymond,

I know you answered this a long time ago and it pertains to the mostly obsolete 3.x transfers, but just wanted to say 'thanks' anyways.

I really liked your explanations - I learned something I didn't know before so will certainly be able to leverage the new knowledge for other types of routines!

Best Regards,

Darryl

Read only

Former Member
0 Likes
1,716

Hi Poonam Roy,

I am also facing same routine problem. I hope u would have solved this problem.

Please send routine code to my mail id.

Your help is appreciated.

my id is: chandu2k@gmail.com

Thanks & Regards,

Chandu

Read only

Former Member
0 Likes
1,716

Isn't this module function (RSDG_ID_GET_FROM_LOGSYS) to be used to retreive ID from system source name ?

from the table rssoursystem, as in RSA1/assignement of source system id ?

it doesn't seem to retreive the current system source name during an extraction...

but i can be wrong....