Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Fill an included [z-field] field at the save of an invoice

I need a way to fill an included field (on VBRK) at the save of an invoice. The catch is that this value needs to be provided by the use; it can't be calculated. What is the easiest way to do this? If need be I can do it on the save of the sales order and I will transport it (to the invoice) at the save of the invoice.

Regards,

Davis

replied

Hi,

please check this sample code for popup..

DATA: s_sval TYPE sval,
      t_sval TYPE TABLE OF sval.

* Prepare the input.
s_sval-fieldname = 'MATNR'.
s_sval-tabname   = 'MARA'.
APPEND s_sval TO t_sval.

* Show the popup.
CALL FUNCTION 'POPUP_GET_VALUES'
  EXPORTING
    no_value_check  = 'X'
    popup_title     = 'Enter commission'
  TABLES
    fields          = t_sval
  EXCEPTIONS
    error_in_fields = 1
    OTHERS          = 2.
IF sy-subrc = 0.

* Get the value entered.
  READ TABLE t_sval INTO s_sval INDEX 1.

  WRITE: / s_sval-value.
ENDIF.

Thanks

Naren

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question