cancel
Showing results for 
Search instead for 
Did you mean: 

not getting output undr billing details and item details in printng invoice

Former Member
0 Kudos

In form interface under import tab i have declared 1 value i.e. IM_FS_KNA1 type KNA1 I have not declared anything except this in form interface.

In Global Definitions under Global Data tab:

IM_T_KNA1 TYPE TABLE OF KNA1

IM_FS_VBRK TYPE VBRK

IM_FS_VBRP TYPE VBRP

W_TOTAL TYPE VBRP-NETWR

IM_T_VBRK TYPE TABLE OF VBRK

IM_T_VBRP TYPE TABLE OF VBRP

under Currency/ Quant Fields

IM_FS_VBRP-NETWR IM_FS_VBRK-WAERK C CURR

In Billin Window, there is a loop from IM_T_VBRK INTO IM_FS_VBRK where KUNAG = IM_FS_KUNNR

In main window, i've created a table for displaying item details

I'm only getting data of Customer in Customer Details window after using driver program. I've checked the entries in the table but for those inputs i'm not getting the desired output..

Following is the code that i'm using for driver program:

*&---------------------------------------------------------------------*
*& Report  ZPRINTINVOICE2
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZPRINTINVOICE2.

TABLES:
  kna1,
  vbrk,
  vbrp.
PARAMETERS :
  p_kunnr LIKE vbrk-kunag,
  p_vbeln LIKE vbrk-vbeln.

DATA :
  /1BCDWB/SF00000214 TYPE rs38l_fnam.             " Name of the Function Module

DATA :  t_vbrk LIKE
STANDARD TABLE
      OF vbrk.

DATA:  t_vbrp LIKE
STANDARD TABLE
      OF vbrp.
 DATA :
  fs_kna1 TYPE kna1,                           " Holds Customer Details
  fs_vbrk LIKE LINE OF t_vbrk,         " Holds BillingDoc Header Details
  fs_vbrp LIKE LINE OF t_vbrp.         " Holds BillingDoc Item Details

START-OF-SELECTION.
  SELECT SINGLE *
           FROM kna1
           INTO fs_kna1
          WHERE kunnr EQ p_kunnr.

   SELECT *
    FROM vbrk
    INTO TABLE t_vbrk
   WHERE kunag EQ p_kunnr
     AND vbeln EQ p_vbeln.
   SELECT *
    FROM vbrp
    INTO TABLE t_vbrp
     FOR ALL ENTRIES IN t_vbrk
   WHERE vbeln = t_vbrk-vbeln.
   CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
      formname                   = 'ZTRYINVOICE2'
    IMPORTING
      fm_name                    = /1BCDWB/SF00000214
    EXCEPTIONS
      no_form                     = 1
      no_function_module = 2
      OTHERS                   = 3.
  IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
   CALL FUNCTION /1BCDWB/SF00000214
    EXPORTING
      im_fs_kna1       = fs_kna1
      im_t_vbrk        = t_vbrk
      im_t_vbrp        = t_vbrp
    EXCEPTIONS
      formatting_error = 1
      internal_error   = 2
      send_error       = 3
      user_canceled    = 4
      OTHERS           = 5.
  IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

plz help......

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi Neha,

Modify your CALL FUNCTION /1BCDWB/SF00000214 like below :

CALL FUNCTION /1BCDWB/SF00000214
    EXPORTING
      im_fs_kna1       =  im_fs_kna1
    TABLES
      im_t_vbrk        = im_t_vbrk
      im_t_vbrp        = im_t_vbrp  
    EXCEPTIONS
      formatting_error = 1
      internal_error   = 2
      send_error       = 3
      user_canceled    = 4
      OTHERS           = 5.
  IF sy-subrc  0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

At Smarforms > Form Interface > Import :

im_fs_kna1.

At Smarforms > Form Interface > Tables :

im_t_vbrk , im_t_vbrp

BR

Dep

Former Member
0 Kudos

Thanks your inputs helped me !!

satvik_panchal
Participant
0 Kudos

In smartform, double click on the table of item details, go to 'data' tab which is just after the 'table' tab. Tick mark the 'Internal Table' check box and write im_t_vbrp into im_fs_vbrp.

Also create structures in se11 named y_ty_vbrk and y_ty_vbrp. Save and activate them.

Then remove the variables im_t_vbrk and im_t_vbrp from the global definitions and write them in form interfaces under import tab as im_t_vbrk type y_ty_vbrk and im_t_vbrp type y_ty_vbrp. Now save and activate the smartform. Test the output from the driver program.

Edited by: Satvikpanchal on Mar 23, 2011 7:09 AM

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

In form interface, declare

IM_T_KNA1 TYPE KNA1

IM_FS_VBRK LIKE VBRP

IM_T_VBRK LIKE VBRK

Then check the syntax and then activate and generate the smartform.Copy and paste the fucntion module generated after activating the smartforms and then replace it with necessary parameters.

Actually im_t_vbrk and im_t_vbrp seems to be table.

Former Member
0 Kudos

Hi

Use table type declarations for the table importing parameters in smartforms interface.

use as below in program:

im_fs_kna1 = fs_kna1

im_t_vbrk = fs_vbrk

im_t_vbrp = t_vbrp

here you have passed vbrp internal tables. So

use table types in declarations in form interface as

im_t_vbrp type tab_vbrp.

Regards,

Raju.

Former Member
0 Kudos

First of all, im_t_vbrp should be transferred with TABLES, not with EXPORTING, and declared in the TABLES portion of the SmartForm parameters, unless it has behind it a table type, which I doubt it.

Try this correction first.

Regards,

George

Former Member
0 Kudos

its not working..If i declare im_fs_kna1 in tables tab, i get dump after executing the driver program...

Error analysis

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_SY_DYN_CALL_PARAM_MISSING', was

not caught and

therefore caused a runtime error.

The reason for the exception is:

When calling the function module "/1BCDWB/SF00000214", one of the parameters

needed according to the interface description was not specified.

This parameter was "IM_FS_KNA1".

No error when i declare under import tab. Please tell what other things can be done for correcting the error.

I get warning messages like

BILL_DET Field IM_FS_VBRK-VBELN has no defined value..

ITEMNO1 Field IM_FS_VBRP-POSNR has no defined value

abd for some other values of VBRP.