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

xth_data table in BPS user exit

Hi,

I am writing a user exit function module and notice the following:

when I get into debug mode, I notice that the data record sequrence is not what I can see from the BPS layout. The first record in the layout become the last record in the xth_data table while the last one become the first.

I have a column where user only need to input the first record and the user exit need to populate this data into all following record.

Any idea how could I make the xth_data table's record to be the same order like the BPS layout?

BTW, I include all the characterisc in the filed to be changed of my user exit, so all the data will pass to the xth_data once.

thanks,

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 29, 2005 at 10:33 PM

    I did anoth test.

    This time, I did not include any characteristic in the filed to be changed, now it only pass one record to the user exit each time and the record is passed according to the order sequeence in the BPS layout. But since I need to pass the data from the first record to all the following records, I have to pass all the records to the user exit one.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Paul P

      Paul,

      XTH_DATA being a hashed table takes the structure of the area you are planning though values are populated for the entries restricted at your level and present in your buffer.

      You can define another table of the same type as say:

      data: it_data type standard table of /1sem/_ys_data_XXXyyyy

      where XXX stands for your system client no. and

      yyyy - area you plan in.

      Also use the SOI pool definitions in your FM.

      Regards,

      Aby

  • author's profile photo Former Member
    Former Member
    Posted on Mar 30, 2005 at 03:22 PM

    Hi Gerd

    Thanks for you input.

    A generic question,

    In BPS layout,if we need to pass the data column's data from first data record to the rest of the record which is from record 2 to the last record, what is best way to do it? As what I know FOX can not make it. Is copying to another table in user exit the only choice?

    Add a comment
    10|10000 characters needed characters exceeded

    • Hello,

      Yes, I think it is the only choice. You can create your local table as a copy of xth_data and sort it in the same way as the data is sorted in the layout. Now if you read the first line you get the first entry in the layout. Now you can loop over the table and modify all other existing records.

      Best regards,

      Gerd Schoeffl

  • Posted on Apr 11, 2005 at 04:49 PM

    Hi

    I need help to write ands execute an fucntion module in BPS.

    All I need in this exit is

    assign 4 digit store number into 8 digit profit center.

    could not do it formula function

    Because could not put together 00001234 where 1234 is store nuber.

    also when I create function module how do send my key fig to it ?

    please pass me any expample with exit (abap se37)

    or any other way to it

    thank you

    RPK

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi RPK,

      here's the function module:

      FUNCTION upf_forecast_exit_execute.

      *"----


      ""Lokale Schnittstelle:

      *" IMPORTING

      *" VALUE(I_AREA) TYPE UPC_Y_AREA

      *" VALUE(I_PLEVEL) TYPE UPC_Y_PLEVEL

      *" VALUE(I_METHOD) TYPE UPC_Y_METHOD

      *" VALUE(I_PARAM) TYPE UPC_Y_PARAM

      *" VALUE(I_PACKAGE) TYPE UPC_Y_PACKAGE

      *" VALUE(IT_EXITP) TYPE UPF_YT_EXITP

      *" VALUE(ITO_CHASEL) TYPE UPC_YTO_CHASEL

      *" VALUE(ITO_CHA) TYPE UPC_YTO_CHA

      *" VALUE(ITO_KYF) TYPE UPC_YTO_KYF

      *" EXPORTING

      *" REFERENCE(ET_MESG) TYPE UPC_YT_MESG

      *" CHANGING

      *" REFERENCE(XTH_DATA) TYPE HASHED TABLE

      *"----


      data: lr_data type ref to data.

      field-symbols: <ls_data>, <store>, <prctr>.

      create data lr_data like line of xth_data.

      assign lr_data->* to <ls_data>.

      assign component:

      'S_CHAS-ZSTORE' of structure <ls_data> to <STORE>,

      'S_CHAS-0PROFIT_CTR' of structure <ls_data> to <PRCTR>.

      loop at xth_data into <ls_data>.

      concatenate '0000' <store> into <prctr>.

      modify xth_data from <ls_data>.

      endloop.

      endfunction.

      Put store and profit center into "fields to be changed".

      Regards,

      Marc

      SAP NetWeaver RIG

  • author's profile photo Former Member
    Former Member
    Posted on Jan 04, 2008 at 07:11 AM

    JW,

    Considering your requirement, you dont need to sort the XTH_DATA table's records to arrange the data within BPS layout. For that there is another table available...it_ll...gurus please help on this front (I am not very certain on the table name

    This table will display the exact structure of your layout as you see it in BPS0.

    But to solve your problem, which I believe, is to populate a particular value xyz into the rest of the cells in your excel layout (particularly for excel layouts --> you could very well use macros to populate them till the last record, and which will get saved accordingly) else, as all have suggested, access XTH_DATA and populate the particular value, you could use the sample code provided by Marc, with slight modifications to suit your requirement.

    Regards,

    Aby

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.