Skip to Content
author's profile photo Former Member
Former Member

Urgent: Problems in Generic Deltas by Function Module

Hi BW Experts,

My requirement is to extract text from CRM to BW using Zfunction module, copy of RSAX_BIW_GET_SIMPLE_DATA

which works fine for full loads but the problem arises only when i go for generic deltas. My code in FM for Deltas is:

LOOP AT s_s_if-t_select INTO l_s_select.

CASE l_s_select-fieldnm.

WHEN 'ZDATE'.

s_date_from = l_s_select-low.

s_date_to = l_s_select-high.

WHEN OTHERS.

ENDCASE.

ENDLOOP.

IF s_date_from IS INITIAL.

s_date_from = '20060401'.

ENDIF.

IF s_date_to IS INITIAL.

s_date_to = '99991231'.

ENDIF.

OPEN CURSOR WITH HOLD S_CURSOR FOR

SELECT * FROM STXH

WHERE TDOBJECT = 'CRM_ORDERH'

AND TDID = 'A002'

AND TDSPRAS = sy-langu

and TDLDATE between s_date_from and s_date_to

or tdfdate between s_date_from and s_date_to.

ENDIF.

FETCH NEXT CURSOR S_CURSOR

APPENDING CORRESPONDING FIELDS

OF TABLE wa_stxh

PACKAGE SIZE S_S_IF-MAXSIZE.

TDFDATE is creation date and TDLDATE is changed on

My extract structure contains Zdate(TDLDATE), Ztext1,2,3, Key field and langu in RSO2 I have selected calday in generic delta and Zdate as field Nm and upper limit as 1 and lower limit as space in settings and new status for changed records button.

Did I missed something because when i check in RSA7 i didnot see any changed records under totals column and i tried to load without it into BW than i didnot received single record evenafter changes.Would anyone suggest me the good solution for it I appreciate it in advance. I have seen lot of posts in SDN but I didnot find this type of secenario anywhere.

Thanks in advance

Regards

Kishore

Add comment
10|10000 characters needed characters exceeded

7 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 04:27 PM

    Hi Nagesh,

    Actually when I check in CRM for each text there is an related GUID in BW; Tdname(70) and Guid(32) is ditinguished by the time which is added to Tdname with Guid ,but when we map tdname to guid in bw only first 32 char will be taken and mapped that is the reason guids get duplicated and gets overwritten ad displyed latest record which is not we want i donot know how to resolve it.Is there any way we can bring Tdname to BW?

    And also I checked today in RSA7 under totals column for generic datasource number of changed records are not displaying.

    Please let me know if you donot understood what i am talking about or need any further information please send me your mail id i will forward you the screenshots.

    I appreciate it in advance.

    Regards

    Kishore

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Kishore,

      I got your point. Let me tell you clearly.

      I will tell you in my case... i'm reading salesorder item text...Sales Order contains 3 items...

      assume order number: 1000 and item 10, 20 and 30.

      while populating the Item text we need to consider 1000 and 10. values for TDNAME in the table STXH...is

      00000001000000010, 00000001000000020 and 00000001000000030 respectively. i need to pass both order and item to BW. otherwise there is no meaning.

      you can do one thing... if you are populating this data to ODS, then create a Date stamp or char IO in BW. keep this IO as key field in ODS.

      Let me know your data flow. send me the details to my id.

      I sent you an email. check your inbox.

      All the best.

      Regards,

      Nagesh Ganisetti.

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2006 at 04:02 PM

    Hi Nagesh,

    I really like this SDN because of Gurus like you I appreciate it know its working in RS3 i can see records but i didnot check in BW whether deltas are loading or not as well as in RSA7 whether under totals deltas are displaying or not and also would you please explain me why previously it didnot come but now its working after changing in data records to 10000 and also would you please tell me how to map Zdate field in ES to BW do i need to create seperate object or as attribute.

    Thanks in advance.

    Regards

    Kishore

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Kishore,

      the only reason is by default it is 100. 100 records per one Package. if these 100 records are old records(because of delete statement it will become 0), then system will show 0 records.

      Once u do initialization run you could see your DS in RSA7.

      Comming to assigning that field in BW Data Model. that comes from the requirement. it doesn't matter whether you will use as charecterstic or attribute.

      DS is some thing like supplying data, it will supply the data, you need to map as per the requirement. all the best.

      Regards,

      Nagesh Ganisetti.

      Assign point if it is useful.

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2006 at 10:08 PM

    Hi Nagesh,

    I appreciate Your answers and i def. award points; I have loaded the text into BW it worked fine evenafter that i didnot seen number of changed records under totals column in RSA7 did it take some time to update the totals column and also as we have taken TDNAME as primary key in extract structure and as we donot have Tdname in BW I have mapped it to GUID in BW. If we take tdname it is unique but if we map to guid they are repeated and when i use them in cube and than create report they get overwritten and displayed as single last text eventhough a single guid has multiple different text do you suggest me anyother way to avoid it as i missing texts:

    example:

    tdname

    4468A96782630110000000000AE08019 20060524222614596

    4468A96782630110000000000AE08019 20060712102800015

    4468A96782630110000000000AE08019 20060628165418486

    But when I map Guid in BW the last text only will be displayed

    Guid:

    4468A96782630110000000000AE08019

    I think we have another option if we use CRMD_ORDERADM_H table rather than STXH by taking process_type, object_id and Guid. Do you suggest me some solution. and also is there anyway we can avoid guid not to display in report;as if text is not there for that particular guid the guid is displaying instead of text because of that report is not looking good.

    I appreciate it in advance for everything for valuable time for patience etc..

    Regards

    Kishore.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Kishore,

      Genrally TDNAME willl contain Document Number and Item.

      Generally Texts will be assigned to Document Numbvers. I would like to know one thing...is GUID contains any item numbers? or take that GUID number, check for the Text in CRM system...where r u now? update your place locations.

      Regards,

      Nagesh Ganisetti.

  • author's profile photo Former Member
    Former Member
    Posted on Jul 31, 2006 at 11:20 PM

    Generic delta on calday works on system date, extracting records till previous day (as I understand). If you have any records with ZDATE greater than " last extraction date - 1" and less than system date, only then will it be selecting those records.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2006 at 12:11 AM

    Kishore,

    go through the thread... which i provided for Generic DS using function for CRM Texts.

    urgent-extraction-through-function-module

    Any questions please let me know. If you have any questions update the thread with your mail id.

    Replace the code with ...

    LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'ZDATE'.

    MOVE-CORRESPONDING L_S_SELECT TO L_R_TDLDATE.

    APPEND L_R_TDLDATE.

    ENDLOOP.

    OPEN CURSOR WITH HOLD S_CURSOR FOR

    SELECT * FROM STXH

    WHERE TDOBJECT = <Text Object>

    AND TDID = <Text ID >

    AND TDSPRAS = sy-langu

    AND (TDLDATE IN L_R_TDLDATE

    or TDFDATE IN L_R_TDLDATE).

    ENDIF. "First data package ?

    • Fetch records into interface table.

    • named E_T_'Name of extract structure'.

    FETCH NEXT CURSOR S_CURSOR

    APPENDING CORRESPONDING FIELDS

    OF TABLE wa_stxh

    PACKAGE SIZE S_S_IF-MAXSIZE.

    L_R_TDLDATE will be calculted by the system. Internally, system will save the Last Delta date(you need to enable this field for Generic delta).

    all the best.

    Regards,

    Nagesh Ganisetti.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2006 at 02:22 AM

    Hi nagesh,

    I appreciate wholeheartedly for immediate response but after following your procedure in function module(FM); FM

    is extracting lots of lots of records(around 1844 records from date 01.03.2005 but i need only records from 01.05.2006) many records are noway related to my requirement in addition to that FM is also bringing german text. And Nagesh I would like to know if I give ZDATE in generic delta in RSO2 does it bring deltas into bw and is it show number of changes in RSA7. And also would You please explain me how to map Zdate in BW do I need to create as attribute to key infoobject or as seperate infoobject and use wherever I use key object.

    Thanks in advance

    Regards

    Kishore.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Kishore,

      LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'ZDATE'.

      MOVE-CORRESPONDING L_S_SELECT TO L_R_TDLDATE.

      APPEND L_R_TDLDATE.

      ENDLOOP.

      OPEN CURSOR WITH HOLD S_CURSOR FOR

      SELECT * FROM STXH

      WHERE TDOBJECT = <Text Object>

      AND TDID = <Text ID >

      AND TDSPRAS = sy-langu

      AND (TDLDATE IN L_R_TDLDATE

      or TDFDATE IN L_R_TDLDATE).

      ENDIF. "First data package ?

      • Fetch records into interface table.

      • named E_T_'Name of extract structure'.

      FETCH NEXT CURSOR S_CURSOR

      APPENDING CORRESPONDING FIELDS

      OF TABLE wa_stxh

      PACKAGE SIZE S_S_IF-MAXSIZE.

      delete wa_stxh where TDLDATE < '20060105'.

      check this condition, you can use similar condition. which will delete the data before 01.05.2006.

      you can keep in L_R_TDLDATE also, it easy delete the records from that. If you want to keep in L_R_TDLDATE, we can write the code.

      If this above delete statement works? let me know i will tell you one more way.

      In RSA7, you will see entries, it works similar to all DS. Comming to Generic Delta, you have enable ZDATE field for Generic Delta then only above code will work.

      Check the Delete statement and let me know. all the best.

      Regards,

      Nagesh Ganisetti.

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2006 at 02:21 PM

    Hi Nagesh,

    I really appreciate Your quick response as well as for good suggestions but nagesh I followed your suggestion but it didnot helped i used delete statement in FM but it is fetching few records when compared to previous scenario and I think so they are correct records but when I check in RSA3 the function module is not running evenafter execution because of that I cannot see any records I mean to say that in RSA3 i cannot see any records after execution of datasource. when I remove delete statement in FM and check in RSA3 the records are coming but with unnecessary data as i said in previous post. And also would you please suggest me what are the steps I need to follow and also If you can send me the steps how to map Zdate in BW do we need to create as attribute or as an seperate infoobject.If you have any document on this please mail me to id akr2754@yahoo.com. I appreciate it in advance. My code looks like this after adding deletion stmt:

    OPEN CURSOR WITH HOLD S_CURSOR FOR

    SELECT * FROM

    -


    -


    FETCH NEXT CURSOR S_CURSOR

    APPENDING CORRESPONDING FIELDS

    OF TABLE wa_stxh

    PACKAGE SIZE S_S_IF-MAXSIZE.

    Delete wa_stxh where TDLDATE < '20060105'.

    IF SY-SUBRC <> 0.

    CLOSE CURSOR S_CURSOR.

    RAISE NO_MORE_DATA.

    ENDIF.

    Thanks a lot

    Regards

    Kishore.

    Add comment
    10|10000 characters needed characters exceeded