Anyone used Z_AW_READ_TEXT to read long text?

Hello everyone,

I’m trying to get long text into SAP RapidMart. I’ve been pointed to the READ_TEXT function. A search revealed also Z_AW_READ_TEXT. I only see the SAP documentation on this and could use a little help with the details if anyone has used this.

One article (http://forums.sdn.sap.com/thread.jspa?messageID=8219834) suggest pulling over the STXH table from SAP and then use it to drive calls using Z_AW_READ_TEXT. Any help would be much appreciated.

I am trying to get the notes associated with each billing fact header (VBRK).

Thanks. Don


donpowell58 :us: (BOB member since 2006-05-18)

Hi,

I used it couple of years ago.

It can be used as a function call in the query transformation in R/3 Data Flow. If RFC enabled, we can use it in dataflow directly.

Possibly let us know what actually you are trying to do with this function.

Regards.
Santosh.


SantoshNirmala :india: (BOB member since 2006-03-15)

Thank you for your response. Would you have a sample of the function used in DS?

Here is what I have so far. I can’t seem to figure out how to specify the long text as the return parm. Also there are 8 parms and I’m getting an errort on the 8th one (says it is not of type INT). Below is a sampe call with a specific long text that exists in SAP.

Thank you again for your help.

R3_DS…READ_TEXT[TDLINE] (0, ‘700’, ‘0001’, ‘E’, ‘’, ‘0060095587’, ‘VBBK’, 0)


donpowell58 :us: (BOB member since 2006-05-18)

Were you able to do it?

I am also getting the same type of error. I f you were able to do it then please share how to get it work.

Thanks!


Archie (BOB member since 2008-06-19)

I have tested it by giving the following parameters(just to test execution)

R3_DS…READ_TEXT[TDLINE] (0, ‘700’, ‘0001’, ‘E’, ‘’, ‘0060095587’, ‘VBBK’, 0)

*** Better use it as a function instead of mapping to a column to a output schema.
It is validating without any error. But the function is not rfc-enabled in our environment.

Note:
here only 7 parameters are listed, 8th parameter seems to be optional or it might expect a nested table as parameter.

Atleast try to test the function with the above parameters and let us know the updates.


SantoshNirmala :india: (BOB member since 2006-03-15)

When I am trying use, it is giving the error
[R/3 Query:Query_1]
BODI-1111081: Invalid mapping expression for column <Query_1.READ_TDLINE>. Additional information: <BODI-1112351: Cannot parse expression.
Parameter is not a valid output parameter for ABAP function <READ_TEXT>. Please verify the name of the chosen output parameter for this function…>.


Archie (BOB member since 2008-06-19)

Any help on it…


Archie (BOB member since 2008-06-19)

Ok leave the output from the function module aside for a while.
Just call the function and take rfc_return code as output and see whether you could call the function module correctly. This should solve the parsing output error atleast. Dont mind, this might require few executions as it will be a trial and error approach.
Then we can try to work with the output of the function module execution.


SantoshNirmala :india: (BOB member since 2006-03-15)

ok! I got it, the function is to be used outside R/3 DF.
I was trying to use this function inside R/3 DF, but this function is to be called in normal DF.
If function that does not found the corresponding values, then it is giving warning. Is it a expected result? How to handle this in DF?


Archie (BOB member since 2008-06-19)

If you have already imported the function module, then confirm whether it is rfc-enabled. Then in the output schema of a query transform, use it as a new function call giving the required parameters. For required parameters check the function module code. Initially test by taking just rfc_returncode as output. If it is running fine then get the required output from the function call.
RFC-enabled function modules can be called either in a R/3DataFlow or a normal DataFlow.


SantoshNirmala :india: (BOB member since 2006-03-15)

A couple of points.

  1. This function should be called from within a normal DF; not and R3 DF.

  2. It cannot be called using the standard DF column command line. Example: You can call a DS function in a Schema Out column like “WL_GetKeyValue (parm1, …)”. This does not work for the Z_AW_READ_TEXT function (because is is an R3 function).

  3. You must call the function as follows:
    A. Add the function into your R3 data store by importing it under “Functions”.
    B. In DF query; Schema Out; right click on column where you want the output to be and select “New Function Call …”
    C. Complete the function setup by providing the parameters (via columns or variables, etc.)
    D. Click through to OK and the output of the function call will be added to the DF Schema Out columns.

See screen shot attached.
Z_AW_Read_Text Function Call.JPG


donpowell58 :us: (BOB member since 2006-05-18)

I had an exact need and followed your detailed information, thanks.

However, when I Excecuted the job I got the following error message:

Input to target <Z_SM_HEADER> contains column that is a nested table type. Input to loader cannot contain a column representing a nested table.


toscajo (BOB member since 2002-09-04)

Rightclick the LINES schema, select make_current and then rightclick again → unnest.

Also you might want to read what I did in that area (plus sub-pages)
http://wiki.sdn.sap.com/wiki/display/EIM/Function+Example+READ_TEXT


Werner Daehn :de: (BOB member since 2004-12-17)

Thanks Werner, just about everything was ‘greyed out’ so couldn’t try your suggestion, but I was able to bypass this whole issue by bringing in another Query. Once I did that I was able to unnest and it brought in my data.

Wo who

Thanks again.


toscajo (BOB member since 2002-09-04)

Hi All,

I am trying to call Z_AW_READ_TEXT wrapper that in turns calls out READ_TEXT functional module to get Long Text at line item levels.
Currently, when I am using it has 7 input parameters, I am sure of 6 parameter values’, but last parameter is being called as LINES (Screenshot 1 - Input_Parameters_Z_AW_READ_TEXT), for which I am not sure of what input should be given.
For time being I have provided NULL as input value for this field (LINES), but I am unable to find any line item level fields in the output parameters or Export Parameters (Screenshot 2 - Output_Parameters_Z_AW_READ_TEXT).
So, I am unable to find any line item level output, only headers are coming out.
In brief, I have 2 questions:

  1. Input Parameter - LINES - What value should be provided?
  2. Output Parameter - Why Line Item level fields are not displayed?

I am attaching screenshots for reference.

Let me know if you want any more details.

Thanks,
Ravi
Input_Parameters_Z_AW_READ_TEXT.jpg
Output_Parameters_Z_AW_READ_TEXT.jpg


d.ravikiran2009 (BOB member since 2011-02-16)

You are correct, Lines should have a NULL value.

I would check the see what fields you are using to pass to the function

i.e. for me to get my text out of SAP I used the following setup see-attachment. It may be that you have an incorrect parameter that is why it cannot find LINES.

Good Luck.
Z_AW_READFunction.jpg


toscajo (BOB member since 2002-09-04)

Test the function in SE37 and check the data in STXH. It is not so difficult to get the right values if you know what is in the header.


Johannes Vink :netherlands: (BOB member since 2012-03-20)

Hi,

Thanks for your response. Please find below screenshot for reference that contains input values that I am providing.
I have tested functional module in SAP, that is not providing values at header item level, however provides correct line item level values.
There are 2 issues here:

  1. With the same input that I am providing in SAP, it is giving line item level values
  2. In DS, while calling the functional module it is not providing Line Item level fields at all in output.

Please find below screenshot for reference with the input values that are being provided and also output in SAP. I am hard coding all input parameters.

Thanks,
Ravi
Z_AW_READ_TEXT_Input_Parameters_Values.jpeg.JPG


d.ravikiran2009 (BOB member since 2011-02-16)

In my example that did look differently, didn’t it?
http://wiki.sdn.sap.com/wiki/display/EIM/Function+Example+READ_TEXT+RFC+enabled


Werner Daehn :de: (BOB member since 2004-12-17)

Hi Werner,

I did followed the example provided in SDN. However, I am not able to get line items in my output when I am calling the functional module ‘Z_AW_READ_TEXT’.
Please refer the post in last (1st) page of this forum only.

Do you know why I am unable to see line items in the output of the function?

Thanks,
Ravi


d.ravikiran2009 (BOB member since 2011-02-16)