Application Development and Automation 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: 
Read only

problem in Infoset Query

anuja_gdhodnge
Participant
0 Likes
1,433

Hello All,

I have created a infoset query in SQ02.

My Query includes below tables:

VBRP VBRK LIKP  J_EXCHDR  KNA1 J_1IRG23D

I need to add the transporter's name which is maintained in header text of outbound delivery.

So i have added that field and entered below code into it.

DATA : GV_NAME TYPE  THEAD-TDNAME,
        GV_DOCNO TYPE THEAD-TDNAME.
DATA : IT_LINE TYPE STANDARD TABLE OF TLINE,
        WA_LINE LIKE LINE OF IT_LINE.
DATA : GV_VGBEL TYPE THEAD-TDNAME.


GV_NAME = VBRP-VBELN.


SELECT SINGLE VGBEL INTO GV_VGBEL
                     FROM VBRP
                     WHERE VBELN = GV_NAME.


REFRESH IT_LINE.
CLEAR   TRANSPORETRS_NAME.
*CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
*  EXPORTING
*    input         = GV_VGBEL
*  IMPORTING
*    OUTPUT        = GV_DOCNO
*          .
CALL FUNCTION 'READ_TEXT'
   EXPORTING
    CLIENT                         = SY-MANDT
     id                            = 'Z003'
     language                      = 'E'
     NAME                          = GV_VGBEL
     OBJECT                        = 'VBBK'
*   ARCHIVE_HANDLE                = 0
*   LOCAL_CAT                     = ' '
* IMPORTING
*   HEADER                        =
*   OLD_LINE_COUNTER              =
   TABLES
     lines                         = IT_LINE
  EXCEPTIONS
    ID                            = 1
    LANGUAGE                      = 2
    NAME                          = 3
    NOT_FOUND                     = 4
    OBJECT                        = 5
    REFERENCE_CHECK               = 6
    WRONG_ACCESS_TO_ARCHIVE       = 7
    OTHERS                        = 8
           .
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
LOOP AT IT_LINE INTO WA_LINE.


   READ TABLE IT_LINE INTO WA_LINE INDEX 1.
   IF SY-SUBRC = 0.
      TRANSPORETRS_NAME = WA_LINE-TDLINE.
   ENDIF.
ENDLOOP.


I am passing VBRP-VBELN to GV_NAME .

When i am debugging , VBRP-VBELN is not having any value?

Hence transporters name is coming as blank.


Please help.


Regards,

Anuja Dhondge

1 ACCEPTED SOLUTION
Read only

anuja_gdhodnge
Participant
0 Likes
1,280

Hello ,

Problem Resolved.

I have added code in CODE Tab.

Instead of that ....we should add code by clicking on below icon which is highlighted in Yellow color.

\

Thanks for your help Jelena.

Regards,

Anuja Dhondge

4 REPLIES 4
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
1,280

Is VBRP part of the JOIN and where did you add this code exactly?

Read only

0 Likes
1,280

Hi Jelena,

Yes VBRP is part of join.

I have adeed one extra field for "Transporters name" in Query.

Then i clicked on code tab.

In that tab i have added this code.

I have also set the debugging point in my code. I goes into debugger.

In debugging i can see the VBRP-VBELN is balnk. Hence it not picking up transporters name.

I tried chaning the value of VBRP-VBELN in debugging mode....then it show the value of "Transporters name".

Please help me.

Rgards,

Anuja Dhondge

Read only

0 Likes
1,280

You need to add the code in the Infoset, not query. If it's an additional field then click Extras button, then add new field and there will be a button to add ABAP code to it. I believe all the fields from JOINed tables should be available there, although I've never used it with the fields that are not in the field catalog, so maybe it needs to be in the catalog too, I'm not 100% sure.

If there is still an issue please post the screenshots of where you added the code exactly.

Read only

anuja_gdhodnge
Participant
0 Likes
1,281

Hello ,

Problem Resolved.

I have added code in CODE Tab.

Instead of that ....we should add code by clicking on below icon which is highlighted in Yellow color.

\

Thanks for your help Jelena.

Regards,

Anuja Dhondge