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

VB_BATCH_GET_DETAIL

HI Guys, im currently doing some work out on a smartform. Im having an issue with VB_BATCH_GET_DETAIL.

After the first run all the correct data is being pulled and populates the lt_char table as it should.

However ever subsequent run the lt_char table is not being populated despite the fact i can see the data i want in the debugger.

Here is my code if anyone can help.

DATA: lt_char TYPE STANDARD TABLE OF clbatch,

ls_char TYPE clbatch,

ls_vbap TYPE vbap.

* Get batch for Material

SELECT SINGLE * FROM vbap INTO ls_vbap

WHERE vbeln = is_vbdka-vbeln

AND matnr = gs_vbdpa-matnr

And CHARG = gs_vbdpa-CHARG.

* Now get batch characteristics

CALL FUNCTION 'VB_BATCH_GET_DETAIL'

EXPORTING

matnr = ls_vbap-matnr

charg = ls_vbap-charg

werks = ls_vbap-werks

*vbeln = is_vbdka-vbeln

get_classification = 'X'

TABLES

char_of_batch = lt_char

EXCEPTIONS

no_material = 1

no_batch = 2

no_plant = 3

material_not_found = 4

plant_not_found = 5

no_authority = 6

batch_not_exist = 7

lock_on_batch = 8

OTHERS = 9.

* Get Batch Number (BATCHNUMBER)

READ TABLE lt_char INTO ls_char

WITH KEY atnam = 'BATCHNUMBER'.

gv_batch = ls_char-atwtb.

* Get Batch Expiry (LOBM_VFDAT)

clear: ls_char.

READ TABLE lt_char INTO ls_char

WITH KEY atnam = 'LOBM_VFDAT'.

break ext-bellr.

gv_batch_exp = ls_char-atwtb.

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 Jun 07, 2012 at 05:58 PM

    Hi Before call the FM VB_BATCH_GET_DETAIL call FM VB_INIT. It will solve your problems.

    Thanks

    Subhankar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 06, 2012 at 11:10 AM

    Hi Michael Hurley

    **********************************************************

    SELECT SINGLE * FROM vbap INTO ls_vbap

    WHERE vbeln = is_vbdka-vbeln

    AND matnr = gs_vbdpa-matnr

    And CHARG = gs_vbdpa-CHARG.

    * Now get batch characteristics

    **************************************************************

    Please check ls_vbap. since u r taking to structure it is giving only one record.

    CLBATCH is a structure.

    Get the datas to internal table.

    Regards,

    Ramya Ramasamy

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi michel

      SELECT SINGLE * FROM vbap INTO ls_vbap instead of tis

      Try this.

      SELECT * FROM vbap INTO lt_char

      you are using single and passing to the work area , so u r getting only one record.

      So in select query use * and pass it into internal table lt_char.

      Regards,

      Ramya Ramasamy

  • author's profile photo Former Member
    Former Member
    Posted on Jun 08, 2012 at 04:40 AM

    Hi,

    As pointet out by Subhankar use FM VB_INIT which will 'Refresh' the buffers.

    Regards

    Raju Chitale

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 29, 2012 at 01:54 PM

    Thanks all.The VB_INIT worked.I really appreciate all who helped espcially Subhankar and Raju.

    Regards,

    Michael

    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.