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

select querry failing

Hi Friends,

I am writing a subroutine in scripts.

I want to get data from vbrk-vbeln->vbfa>vbelv->vbak->vbeln->konv->knumv.

my input is VBDKR-VBELN.

My select querry is failing.

can any code this and help me out in this.

Regards,

Venu

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2006 at 04:11 AM

    Hi,

    Try this..

    DATA: V_VBELN LIKE VBAK-VBELN.

    SELECT VBELV UP TO 1 ROWS

    INTO V_VBELN

    FROM VBFA

    WHERE VBELN = VBDKR-VBELN

    AND VBTYP_V = 'C'.

    ENDSELECT.

    TABLES: VBAK.

    SELECT SINGLE * FROM

    VBAK

    WHERE VBELN = V_VBELN.

    DATA: T_KONV LIKE KONV OCCURS 0 WITH HEADER LINE.

    SELECT * FROM KONV

    INTO TABLE T_KONV

    WHERE KNUMV = VBAK-KNUMV.

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2006 at 05:10 AM

    Hi,

    Please explain what is "how to append the data to the internal and call in form"..

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Naren,

      This my code, and data is in all the three internal table I want to pass the data to the form through Subroutine, Can you tell me how to do it.

      DATA : BEGIN OF IT_VBRP OCCURS 0,

      VBELN LIKE VBRP-VBELN,

      VRKME LIKE VBRP-VRKME,

      END OF IT_VBRP.

      DATA : BEGIN OF IT_VBFA OCCURS 0,

      VBELN LIKE VBFA-VBELN,

      VBELV LIKE VBFA-VBELV,

      END OF IT_VBFA.

      DATA : BEGIN OF IT_VBAK OCCURS 0,

      VBELN LIKE VBAK-VBELN,

      VKBUR LIKE VBAK-VKBUR,

      VKGRP LIKE VBAK-VKGRP,

      KNUMV LIKE VBAK-KNUMV,

      END OF IT_VBAK.

      DATA : BEGIN OF IT_KONV OCCURS 0,

      KBETR LIKE KONV-KBETR,

      END OF IT_KONV.

      DATA : IVBELN TYPE VBRK-VBELN.

      DATA : OVBELN TYPE VBRK-VBELN.

      READ TABLE INPUT WITH KEY 'VBDKR-VBELN'.

      IVBELN = INPUT-VALUE.

      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

      EXPORTING

      INPUT = IVBELN

      IMPORTING

      OUTPUT = OVBELN.

      SELECT SINGLE VBELN VRKME FROM VBRP INTO IT_VBRP

      WHERE VBELN = OVBELN.

      IF SY-SUBRC EQ 0.

      SELECT SINGLE VBELN VBELV FROM VBFA INTO IT_VBFA

      WHERE VBELN = IT_VBRP-VBELN

      AND VBTYP_N = 'M'.

      ENDIF.

      IF SY-SUBRC = 0.

      SELECT SINGLE VBELN VKBUR VKGRP KNUMV FROM VBAK INTO IT_VBAK

      WHERE VBELN = IT_VBFA-VBELV.

      ENDIF.

      Thanx in advance,

      Venu.

  • author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2006 at 05:21 AM

    Hi,

    PERFORM FORM1 TABLES IT_VBRP

    IT_VBFA

    IT_VBAK.

    FORM FORM1 TABLES PT_VBRP

    PT_VBFA

    PT_VBAK.

    ENDFORM.

    Is this what you want..

    THanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2006 at 05:32 AM

    Hi,

    Do you want to call this subroutine from the sapscript form..Correct??

    But in the sap script form you can pass only single parameters and not an internal table..

    Thanks,

    Naren

    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.