cancel
Showing results for 
Search instead for 
Did you mean: 

infopackage routine for time-dependant characteristic - need help with code

Former Member
0 Kudos

Hi Gurus,

i am quite new to abap-routines and welcome your help. I want to set in my infopackage for the time-dependant characteristic 0Person dateto and datefrom. Therefore I need to reed according date from datasource.

Here the code, but unfortunatly i got the message Field TRAN_STRUCTURE is unknow. Can you tell me what's wrong?


program conversion_routine.
* Type pools used by conversion program
type-pools: rsarc, rsarr, rssm.
tables: rsldpsel.
* Global code used by conversion rules
*$*$ begin of global - insert your declaration only below this line  *-*
* TABLES: ...
* DATA:   ...
*$*$ end of global - insert your declaration only before this line   *-*
* -------------------------------------------------------------------
form compute_time_dependent_dates
     using p_infopackage type rslogdpid
  changing p_datefrom    type d
           p_dateto      type d
           p_subrc       like sy-subrc.
*       Insert source code to current selection field
*$*$ begin of routine - insert your code only below this line        *-*
          p_datefrom = TRAN_STRUCTURE-BEGDA.
          p_dateto   = TRAN_STRUCTURE-ENDDA.
*....
          p_subrc = 0.

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

Thanks for your help

birgit

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thanks for your quick answer 🐵

I need to load employees info into 0person, which is a time dependant characteristic. Employees change and we need to know who has done what in the past.

The extractor 0person_attr delivers begda(begin of valadity) and endda( end of valadity) , which I want to use for valadity in 0person. I've related the fields in the transferrule, but I have to select something on the update-tab of my infopackage, haven't I?

Birgit

Former Member
0 Kudos

The Time interval you specify in the infopackage is the input you have to give to the extractor so that it can fetch only the records which are valid in this time interval from the ERP system.

If you donot specify any values here, then the extractor takes default time interval and pulls all records valid from 01/01/1900 till 12/31/9999. Now if you specify this time interval say 01/01/2008 and 12/31/2009, these values are passed to extractor and it fetches only all the person master data which is valid in this new time period instead of the default 01/01/1900 - 12/31/2009.

So you cannot get this time period begin date and end date from the datasource. You have to determine yourself what is the valid interval is going to be as per the business rule and initialize it .

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks for your help, you solved my problem.

kind regards

birgit

Former Member
0 Kudos

What do you mean by "Read according date from data source" ? Datasource does not contain any dates?

From where are you planning to fill in these dates in the routine ? Is it a table or begining and ending of the current year ? What is the logic you plan to use to populate these dates ?

Former Member
0 Kudos

TRAN_STRUCTURE is likely not available to you as a global variable. The purpose of the InfoPack subroutine is for you to assign a value to p_datefrom and p_dateto, using whatever your business rules are.

For example, you could assign the dates to be from the current date and back seven days. Or it they could be dates that you get from a DSO or master data via a SQL call.

What are your business requirements?