Application Development 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: 

Get text from trfcqdata-arfcdata01-07

0 Kudos
692

Friends,

  Our users need a report showing data from inbound queues.  They want to be able to be able to restrict by and display by several fields that are in the trfcqdata-arfcdata01 - trfcqdata-arfcdata07 fields, which are 256 raw fields.  I have run the data through several raw to text function modules, but I can still not 'see' all the data, just the headings.  I have gone thourgh searching for arfcdata01, trfcqdata and others but I have not found a solution yet.  Thank you for any help on this and I will award helpful answers.

Kevin

1 ACCEPTED SOLUTION

Former Member
0 Kudos
240

When queue contents are shown in qRFC monitor, FM /SPE/QUEUE_CONTAINER_SHOW is called.

This FM in turn calls QRFC_PLAYBACK, and then calls a screen to display contents.

Debugging will give you exact logic.

11 REPLIES 11

Former Member
0 Kudos
240

Hi Hill,

You can try the solution here to convert hex to char http://scn.sap.com/message/347381.

My assumption is that Hex & Raw values are same, if they are different anybody please chip in and explain.

BR.

0 Kudos
240

Ankit,

  This looks like it has possibilities and I am trying to test it.  I do have a question:  The code uses the

   FIELD-SYMBOLS <pn> without ever assigning it, but it then goes on to use the value.  I am trying to figure out the logic and fix it.

assign a1 to <n> casting.

move <n> to rn.

move <pn> to rn1.

c = rn1+3(1).

0 Kudos
240

Hi Hill,

I also could not quite get the solution at the above post. Sorry for that.

I checked this FM and it works -NLS_STRING_CONVERT_TO_SYS

Example pass as -

LANG_USED                       EN

SOURCE                          41

FROM_FE                         MS

Output would Char A.

BR.

Former Member
0 Kudos
241

When queue contents are shown in qRFC monitor, FM /SPE/QUEUE_CONTAINER_SHOW is called.

This FM in turn calls QRFC_PLAYBACK, and then calls a screen to display contents.

Debugging will give you exact logic.

0 Kudos
240

Manish,

  I have spent hours in debug in these Function Modules and I am still not sure where or how the conversion is being done.  I know that the data is in the format like Idocs and I have been able to run raw to text and I can see the headings, but I am not sure how to get the hex part and put into a structure to be able to get out the information.  Maybe I will need to keep trying.  Thanks!

0 Kudos
240

Standard is using RFC interface and internal call statements which indirectly parse the hex data to various internal tables, and then there is another table that contains reference to all parameters.

I took a shortcut and copied FM /SPE/QUEUE_CONTAINER_SHOW to ZFM.

Internal table GT_PARA has all the required data just after FM call QRFC_PLAYBACK.

So I commented out the logic thereafter (call screen statement to display gt_para). Your report can call such FM to get contents of GT_PARA.

NOTE:

Suppose QRFC will run FM /SPE/INB_DELIVERY_CONFIRM_DEC to process data.

On first run, FM /SPE/QUEUE_CONTAINER_SHOW will create a copy of above FM and replaces last character with X.

Since FM /SPE/INB_DELIVERY_CONFIRM_DEX is already existing, I modified the custom FM so that shadow FM name is Z1234567_DELIVERY_CONFIRM_DEX created under my function group. Length of RFC FM and shadow FM must be same, otherwise dumps will occur.

0 Kudos
240

Manish,

  Then there is still a need to get the data out of the table pointed to by the GT_PARA-REF field.  That is the data, such as material, plant, location, movement type etc that I need. Thanks!

0 Kudos
240

Dynamic programming is needed for that.

Assign the table reference to a field symbol, and then loop into it.

Something like this:

FIELD-SYMBOLS <lt> TYPE ANY TABLE.

FIELD-SYMBOLS <ls> TYPE ANY.

ASSIGN gs_para-ref->* TO <lt>.

LOOP AT <lt> ASSIGNING <ls>.

  "see values in debug mode

  "use ASSIGN COMPONENT to get specific field value from <ls>

ENDLOOP.

0 Kudos
240

Manish,

  I have been trying to get this to work, but it just does not seem too.  It actually gets the data and puts it into at structure, as below, IS_GOODSMVT_HEADER, but when I call the FM,

  RFC_RUN_XAB_DRIVER, that ends up getting the data it errors because nothing is in the gt_para that it can see (it is in my program as a globab, but...) and if I try to execute the code in my program, it does not find the GOODSMVT_HEADER.

  Do you have any more suggestions?  I feel that it is close, and I can see the data in debug, but I cannot get around the errors when I run it.  Thanks!

 

from /SPE/GOODSMVT_CREATX:

field-symbols: <lt> type table.
read table gt_para assigning <gs_para> with key nam ='IS_GOODSMVT_HEADER'.
ASSIGN <gs_para>-ref->* TO <lt>.
append IS_GOODSMVT_HEADER to <lt>.

Kevin

0 Kudos
240

If you have created a copy of FM /SPE/QUEUE_CONTAINER_SHOW, it should not be calling FM /SPE/GOODSMVT_CREATX. Custom FM should be calling a custom generated FM, something like Z1234567_GOODSMVT_CREATX. (both FM to be in same function group, so that gt_para set by one FM is visible to other)

Look for these lines in FM /SPE/QUEUE_CONTAINER_SHOW.

  if lv_func_exist eq abap_false.

*** No, function must be generated

*** First the function itself, with exactly the same interface than

*** function mentioned originally in queue entry

*** split function group into poolname & namespace

    split lv_own_group at '/' into lv_s1 lv_s2 lv_s3.

    concatenate '/' lv_s1 lv_s2 '/' into lv_namespace.

    call function 'FUNCTION_CREATE'

. . . . .

*** Now the source code for the function must be generated

. . . . .

    concatenate 'Function' lv_new_fname '.'                 "#EC NOTEXT

      into lt_source separated by ' '.                      "#EC NOTEXT

    append lt_source.

    append 'field-symbols: <lt> type table.' to lt_source.  "#EC NOTEXT

. . . . .

    insert report lv_include from lt_source state 'A'.

*** Raise exception to show the caller that new function

*** was created and re-call is necessary

    raise new_fm_created.

  endif.

When standard FM was run for first time, FM /SPE/GOODSMVT_CREATX did not exist. At that time, variable lv_new_fname was populated with /SPE/GOODSMVT_CREATX, and then FM was generated. Subsequent runs do not regenerate FM because FM FUNCTION_EXISTS was able to find FM /SPE/GOODSMVT_CREATX.

Similarly, you need to modify logic so that custom FM creates custom FM like Z1234567_GOODSMVT_CREATX.

When I was trying it out, I had tweaked lv_new_fname value so that /SPE/ is replaced by something Z.

Standard code:

*** Tinker function name (replace last character with 'X')

*** NOTE: Length of original lv_intfc_func_name MUST NOT

***       be changed (for QRFC_PLAYBACK DUMPs otherwise) !!!!

  lv_new_fname = lv_intfc_func_name.

  lv_len = strlen( lv_new_fname ) - 1.

  lv_new_fname+lv_len(1) = 'X'.

Was replaced by this snippet in custom copy of /SPE/QUEUE_CONTAINER_SHOW.

*** Tinker function name (replace last character with 'X')

*** NOTE: Length of original lv_intfc_func_name MUST NOT

***       be changed (for QRFC_PLAYBACK DUMPs otherwise) !!!!

  lv_new_fname = lv_intfc_func_name.

  lv_len = strlen( lv_new_fname ) - 1.

  lv_new_fname+lv_len(1) = 'X'.

* tinker function name again for customer namespace

  lv_len = strlen( lv_new_fname ).

  check lv_len gt 7.    "ZTESTFM needs 7 chars

  lv_new_fname+0(7) = 'ZTESTFM'.

As a result, first run of custom FM would result in FM ZTESTFMODSMVT_CREATX (function group same as custom FM) created instead of /SPE/GOODSMVT_CREATX.

If it still doesn't work, I can post the full snippet in blog or wiki.

0 Kudos
240

Hi,

I already started a question regarding that topic. My question is: If one changes the interface of a function module e.g. Z_EW_PROCORDCONF_CREATE_HDR, is it possible to regenerate the corresponding Z_EW_PROCORDCONF_CREATE_HDX module to adjust its interface to the other module?

Thanks a lot in advance.

Volker Bock