This website is not affiliated with, sponsored by, or approved by SAP AG.

Edit Internal Table for Sales Order Smartform (Y640_SDORC_A)

Development SAPscript/ Smartforms

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Edit Internal Table for Sales Order Smartform (Y640_SDORC_A)

Postby Sapslzr » Wed Apr 06, 2011 4:37 pm

I want to modify SmartForm Y640_SDORC_A so I always print the net value and discount percentage.

I have an access sequence and my discount can be created by a discount percentage condition (ZD00) or by Special Price (PR01) condition.

My problem is that if I use the Special Price Condition the Internal Table where the smartform loops to get the price only gets the Net Value amount, and it wont print the discount percentage, but if I dont use the Special Price condition the internal value has 2 rows the first one is for Discount Condition and the second for Net Value and it prints correctly.

This is how my access secuence is arranged, the X are the print id column:

PR00 Price
ZD00 Discount (X)
PR01 Special Price
--- Net Value (X)

How can I fix the internal table creation so when there is a Special Price Condition (PR01) the internal table also gets the Discount percentage value.

Here is my Forms Code:

Code: Select all
*&--------------------------------------------------------------------*
*&      Form  GET_ITM_PRICE_TABLE
*&--------------------------------------------------------------------*
*---------------------------------------------------------------------*
FORM get_itm_price_table
USING
is_vbdpa             TYPE vbdpa
is_vbdka             TYPE vbdka
iv_price_print_mode  TYPE c
iv_spras             TYPE spras
CHANGING
ct_komv              TYPE t_komv_tab
ct_komvd             TYPE t_komvd_tab
cs_komk              TYPE komk.

  DATA ls_komp TYPE komp.
  DATA ls_komk TYPE komk.
*  DATA lt_tkomv  TYPE STANDARD TABLE OF komv.

  IF ls_komk-knumv NE is_vbdka-knumv OR
  ls_komk-knumv IS INITIAL.

    CLEAR ls_komk.
    ls_komk-mandt = sy-mandt.
    ls_komk-kalsm = is_vbdka-kalsm.
    ls_komk-kappl = 'V'.
    ls_komk-waerk = is_vbdka-waerk.
    ls_komk-knumv = is_vbdka-knumv.
    ls_komk-knuma = is_vbdka-knuma.
    ls_komk-vbtyp = is_vbdka-vbtyp.
    ls_komk-land1 = is_vbdka-land1.
    ls_komk-vkorg = is_vbdka-vkorg.
    ls_komk-vtweg = is_vbdka-vtweg.
    ls_komk-spart = is_vbdka-spart.
    ls_komk-bukrs = is_vbdka-bukrs_vf.
    ls_komk-hwaer = is_vbdka-waers.
    ls_komk-prsdt = is_vbdka-erdat.
    ls_komk-kurst = is_vbdka-kurst.
    ls_komk-kurrf = is_vbdka-kurrf.
    ls_komk-kurrf_dat = is_vbdka-kurrf_dat.

  ENDIF.

  ls_komp-kposn = is_vbdpa-posnr.
  ls_komp-kursk = is_vbdpa-kursk.
  ls_komp-kursk_dat = is_vbdpa-kursk_dat.
  IF is_vbdka-vbtyp CA 'HKNOT6'.
    IF is_vbdpa-shkzg CA ' A'.
      ls_komp-shkzg = 'X'.
    ENDIF.
  ELSE.
    IF is_vbdpa-shkzg CA 'BX'.
      ls_komp-shkzg = 'X'.
    ENDIF.
  ENDIF.


  IF iv_price_print_mode EQ 'A'.
    CALL FUNCTION 'RV_PRICE_PRINT_ITEM'
      EXPORTING
        comm_head_i = ls_komk
        comm_item_i = ls_komp
        language    = iv_spras
      IMPORTING
        comm_head_e = ls_komk
        comm_item_e = ls_komp
      TABLES
        tkomv       = ct_komv
        tkomvd      = ct_komvd.
  ELSE.
    CALL FUNCTION 'RV_PRICE_PRINT_ITEM_BUFFER'
      EXPORTING
        comm_head_i = ls_komk
        comm_item_i = ls_komp
        language    = iv_spras
      IMPORTING
        comm_head_e = ls_komk
        comm_item_e = ls_komp
      TABLES
        tkomv       = ct_komv
        tkomvd      = ct_komvd.
  ENDIF.
  cs_komk = ls_komk.
ENDFORM.                    "get_itm_price_table




Regards,
Carlos
Meditate Everyday
Sapslzr
 
Posts: 119
Joined: Sat Oct 24, 2009 11:43 am

Return to SAPscript/Smartforms

Who is online

Users browsing this forum: No registered users and 2 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.