<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: problem with VOFM in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-vofm/m-p/5557554#M1268331</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thnx for the reply i have sent thios mail to your id.can you tell where exactlyi put the sy-subrc=0?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 May 2009 09:40:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-18T09:40:56Z</dc:date>
    <item>
      <title>problem with VOFM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-vofm/m-p/5557552#M1268329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;I am having problem with VF01. one sales document having 3 line items like this:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;item     descrptn                           invoiced quantity       net value           material             cost&lt;/P&gt;&lt;P&gt;10       MATERIAL ITEM 11                      0                     0                  MITEM11             0&lt;/P&gt;&lt;P&gt;20       MATERIAL ITEM 12                      0                     0                  MITEM12             0&lt;/P&gt;&lt;P&gt;30       MATERIAL ITEM 13                    30                9000                  MITEM13             30000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now inspite of line item 10 and 20 does not have any value still it is coming into invoice i.e zero(0) values get copied to invoice for VF01.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now there is a routine 928-Order-related.3rd Party Item in VOFM.&lt;/P&gt;&lt;P&gt;here inside that loop (LOOP AT gi_vbep INTO gwa_vbep.)&lt;/P&gt;&lt;P&gt; every item is copied to gwa_vbep.&lt;/P&gt;&lt;P&gt;what change in the code i need to do to stop other values coming to invoice.&lt;/P&gt;&lt;P&gt;i have given the code below:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM BEDINGUNG_PRUEFEN_928.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Data declaration for additional check from routine 900.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data:&lt;/P&gt;&lt;P&gt;    gv_lfrel type vbep-lfrel,&lt;/P&gt;&lt;P&gt;    gv_subrc type sy-subrc,&lt;/P&gt;&lt;P&gt;    gv_text(34) type c,&lt;/P&gt;&lt;P&gt;    gv_vbeln type vbfa-vbeln,&lt;/P&gt;&lt;P&gt;    gv_posnn type vbfa-posnn,&lt;/P&gt;&lt;P&gt;    gv_ebeln type ekpo-ebeln,&lt;/P&gt;&lt;P&gt;    gv_ebelp type ekpo-ebelp,&lt;/P&gt;&lt;P&gt;    gv_elikz type ekpo-elikz,&lt;/P&gt;&lt;P&gt;    gv_vbeln2 type vbfa-vbeln,&lt;/P&gt;&lt;P&gt;    gv_lfsta type vbup-lfsta.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*begin of DDIK902383&lt;/P&gt;&lt;P&gt;data : gv_rfmng type vbfa-rfmng,&lt;/P&gt;&lt;P&gt;       gv_rfmng1 type vbfa-rfmng.&lt;/P&gt;&lt;P&gt;*end of DDIK902383&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Constants declaration&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data:&lt;/P&gt;&lt;P&gt;    c_x(1) type c value 'X',&lt;/P&gt;&lt;P&gt;    c_c(1) type c value 'C',&lt;/P&gt;&lt;P&gt;    c_4 type i value 4,&lt;/P&gt;&lt;P&gt;    c_0 type i value 0,&lt;/P&gt;&lt;P&gt;    c_text1(6) type c value 'item',&lt;/P&gt;&lt;P&gt;    c_text2(22) type c value 'is not fully completed'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*begin of DDIK902383&lt;/P&gt;&lt;P&gt;data : c_r(1) type c value 'R',&lt;/P&gt;&lt;P&gt;       c_m(1) type c value 'M',&lt;/P&gt;&lt;P&gt;       c_a(1) TYPE c VALUE 'A',&lt;/P&gt;&lt;P&gt;       c_b(1) TYPE c VALUE 'B',&lt;/P&gt;&lt;P&gt;       c_j(1) TYPE c VALUE 'J'.&lt;/P&gt;&lt;P&gt;*end of DDIK902383&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table declaration&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  Types:&lt;/P&gt;&lt;P&gt;      begin of gty_vbep,&lt;/P&gt;&lt;P&gt;        vbeln type vbep-vbeln,&lt;/P&gt;&lt;P&gt;        posnr type vbep-posnr,&lt;/P&gt;&lt;P&gt;        lfrel type vbep-lfrel,&lt;/P&gt;&lt;P&gt;        banfn type vbep-banfn,&lt;/P&gt;&lt;P&gt;      end of gty_vbep.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*begin of DDIK902383&lt;/P&gt;&lt;P&gt;types : begin of gty_vbap,&lt;/P&gt;&lt;P&gt;        vbeln type vbap-vbeln,&lt;/P&gt;&lt;P&gt;        posnr type vbap-posnr,&lt;/P&gt;&lt;P&gt;       end of gty_vbap,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        begin of gty_vbfa,&lt;/P&gt;&lt;P&gt;        vbeln type vbfa-vbeln,&lt;/P&gt;&lt;P&gt;        vbelv type vbfa-vbelv,&lt;/P&gt;&lt;P&gt;        posnv type vbfa-posnv,&lt;/P&gt;&lt;P&gt;        rfmng type vbfa-rfmng,&lt;/P&gt;&lt;P&gt;        vbtyp_n type vbfa-vbtyp_n,&lt;/P&gt;&lt;P&gt;        vbtyp_v type vbfa-vbtyp_v,&lt;/P&gt;&lt;P&gt;        end of gty_vbfa.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;internal table declaration and workarea declaration&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;data : i_vbap type standard table of gty_vbap,&lt;/P&gt;&lt;P&gt;       i_vbfa type standard table of gty_vbfa,&lt;/P&gt;&lt;P&gt;       i_vbfa1 type standard table of gty_vbfa,&lt;/P&gt;&lt;P&gt;       gwa_vbap type gty_vbap,&lt;/P&gt;&lt;P&gt;       gwa_vbfa type gty_vbfa,&lt;/P&gt;&lt;P&gt;       gwa_vbfa1 type gty_vbfa.&lt;/P&gt;&lt;P&gt;types : begin of gty_eban,&lt;/P&gt;&lt;P&gt;banfn type eban-banfn,&lt;/P&gt;&lt;P&gt;ebeln type eban-ebeln,&lt;/P&gt;&lt;P&gt;bsmng type eban-bsmng,&lt;/P&gt;&lt;P&gt;end of gty_eban,&lt;/P&gt;&lt;P&gt; begin of gty_ekpo,&lt;/P&gt;&lt;P&gt; ebeln type ekpo-ebeln,&lt;/P&gt;&lt;P&gt; ebelp type ekpo-ebelp,&lt;/P&gt;&lt;P&gt; elikz type ekpo-elikz,&lt;/P&gt;&lt;P&gt; end of gty_ekpo,&lt;/P&gt;&lt;P&gt; begin of gty_vbup,&lt;/P&gt;&lt;P&gt; vbeln  type vbup-vbeln,&lt;/P&gt;&lt;P&gt; gbsta type vbup-gbsta,&lt;/P&gt;&lt;P&gt; end of gty_vbup,&lt;/P&gt;&lt;P&gt; begin of gty_vbup1,&lt;/P&gt;&lt;P&gt; vbeln  type vbup-vbeln,&lt;/P&gt;&lt;P&gt; lfsta type vbup-lfsta,&lt;/P&gt;&lt;P&gt; gbsta type vbup-gbsta,&lt;/P&gt;&lt;P&gt; end of gty_vbup1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : li_ekpo type standard table of gty_ekpo,&lt;/P&gt;&lt;P&gt;       lwa_ekpo type gty_ekpo,&lt;/P&gt;&lt;P&gt;       li_eban type standard table of gty_eban,&lt;/P&gt;&lt;P&gt;       lwa_eban type gty_eban,&lt;/P&gt;&lt;P&gt;       li_vbup type standard table of gty_vbup,&lt;/P&gt;&lt;P&gt;       lwa_vbup type gty_vbup,&lt;/P&gt;&lt;P&gt;       li_vbup1 type standard table of gty_vbup1,&lt;/P&gt;&lt;P&gt;       lwa_vbup1 type gty_vbup1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table declaration&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data:&lt;/P&gt;&lt;P&gt;    gi_vbep type standard table of gty_vbep.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Work area declaration&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: gwa_vbep type gty_vbep.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;End of data declaration for additional check from routine 900.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;  CHECK : ANALYZE_MODE IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Billing Block&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF VBAP-FAKSP NE SPACE.&lt;/P&gt;&lt;P&gt;    SELECT SINGLE * FROM TVFSP WHERE FAKSP = VBAP-FAKSP&lt;/P&gt;&lt;P&gt;                               AND   FKART = TVFK-FKART.&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;      PERFORM VBFS_HINZUFUEGEN USING VBAP-POSNR '015' SPACE&lt;/P&gt;&lt;P&gt;                                                      SPACE SPACE.&lt;/P&gt;&lt;P&gt;      SY-SUBRC = 4.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Billing Status&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IF VBUP-FKSAA = ' '.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IF VBUP-FKSAA = 'C'.&lt;/P&gt;&lt;P&gt;    PERFORM VBFS_HINZUFUEGEN_ALLG&lt;/P&gt;&lt;P&gt;               USING VBAP-VBELN VBAP-POSNR  'VF' 'I' '045'&lt;/P&gt;&lt;P&gt;                     SPACE SPACE SPACE SPACE.&lt;/P&gt;&lt;P&gt;    SY-SUBRC = 4.&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check order related billing relevancy of item category&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF VBAP-FKREL NA 'BF'.&lt;/P&gt;&lt;P&gt;    PERFORM VBFS_HINZUFUEGEN_ALLG&lt;/P&gt;&lt;P&gt;               USING VBAP-VBELN VBAP-POSNR  'VF' 'I' '044'&lt;/P&gt;&lt;P&gt;                     SPACE SPACE SPACE SPACE.&lt;/P&gt;&lt;P&gt;    SY-SUBRC = 4.&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Billing Block in Customer Master&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF KURGV-FAKSD NE SPACE.&lt;/P&gt;&lt;P&gt;    SELECT SINGLE * FROM TVFSP WHERE FAKSP = KURGV-FAKSD&lt;/P&gt;&lt;P&gt;                               AND   FKART = TVFK-FKART.&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;      PERFORM VBFS_HINZUFUEGEN USING '000000' '068' KURGV-KUNNR&lt;/P&gt;&lt;P&gt;                                                    SPACE SPACE.&lt;/P&gt;&lt;P&gt;      SY-SUBRC = 4.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check that there is a quantity due to be billed&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF VBRP-FKIMG = 0.&lt;/P&gt;&lt;P&gt;    PERFORM VBFS_HINZUFUEGEN_ALLG&lt;/P&gt;&lt;P&gt;               USING VBAP-VBELN VBAP-POSNR  'VF' 'I' '147'&lt;/P&gt;&lt;P&gt;                     SPACE SPACE SPACE SPACE.&lt;/P&gt;&lt;P&gt;    SY-SUBRC = 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check that no negative billing documents are created&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF TVFK-VBTYP = 'M'.&lt;/P&gt;&lt;P&gt;    IF VBRP-SHKZG CA 'BX'.&lt;/P&gt;&lt;P&gt;      SY-SUBRC = 4.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  IF ( TVCPF-FKMGK = 'F' AND VBAPF-REWRT = 0 ) OR&lt;/P&gt;&lt;P&gt;     TVFK-VBTYP = 'O'.&lt;/P&gt;&lt;P&gt;    VBRP-WAVWR = '0.01'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Code inserted for additional check from routine 900&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;SELECT vbeln posnr lfrel banfn&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;FROM vbep&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;INTO TABLE gi_vbep&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;WHERE vbeln EQ vbap-vbeln.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;if gi_vbep[] is not initial.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;select banfn ebeln bsmng&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;         &lt;STRONG&gt;from eban&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;         &lt;STRONG&gt;into table li_eban&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;         &lt;STRONG&gt;for all entries in gi_vbep&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;         &lt;STRONG&gt;where banfn = gi_vbep-banfn&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;         &lt;STRONG&gt;and bsmng NE 0.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;         &lt;STRONG&gt;if sy-subrc = 0.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;         &lt;STRONG&gt;select ebeln ebelp elikz&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;                 &lt;STRONG&gt;from ekpo into table li_ekpo&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;                 &lt;STRONG&gt;for all entries in li_eban&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;              &lt;STRONG&gt;where ebeln eq li_eban-ebeln&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;             &lt;STRONG&gt;and elikz eq c_x.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;          &lt;STRONG&gt;endif.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;          &lt;STRONG&gt;endif.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select vbeln vbelv posnv rfmng vbtyp_n vbtyp_v&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;from vbfa&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;into table i_vbfa1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;for all entries in gi_vbep&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;where vbelv eq gi_vbep-vbeln&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;        &lt;STRONG&gt;and posnv eq gi_vbep-posnr&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;        &lt;STRONG&gt;and vbtyp_n eq c_j&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;        &lt;STRONG&gt;and vbtyp_v eq c_c.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if sy-subrc eq 0.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select vbeln lfsta gbsta from vbup&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;        &lt;STRONG&gt;into table li_vbup1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;        &lt;STRONG&gt;for all entries in i_vbfa1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;        &lt;STRONG&gt;where vbeln = i_vbfa1-vbelv.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select vbeln gbsta from vbup&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;        &lt;STRONG&gt;into table li_vbup&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;        &lt;STRONG&gt;for all entries in i_vbfa1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;        &lt;STRONG&gt;where vbeln = i_vbfa1-vbeln.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;endif.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;LOOP AT gi_vbep INTO gwa_vbep.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;CLEAR:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;gv_vbeln2,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;gv_lfsta.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;IF NOT gwa_vbep-banfn IS INITIAL.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;read table li_eban into lwa_eban&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;       &lt;STRONG&gt;with key banfn = gwa_vbep-banfn.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         &lt;STRONG&gt;if sy-subrc = 0.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Read table li_ekpo into lwa_ekpo&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;with key ebeln = lwa_eban-ebeln&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;               &lt;STRONG&gt;elikz = c_x.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;        IF sy-subrc NE c_0.&lt;/P&gt;&lt;P&gt;          sy-subrc = c_4.&lt;/P&gt;&lt;P&gt;          gv_subrc = sy-subrc.&lt;/P&gt;&lt;P&gt;          gv_vbeln2 = gwa_vbep-posnr.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;      ELSE.&lt;/P&gt;&lt;P&gt;        sy-subrc = c_4.&lt;/P&gt;&lt;P&gt;        gv_subrc = sy-subrc.&lt;/P&gt;&lt;P&gt;        gv_vbeln2 = gwa_vbep-posnr.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ELSEIF gwa_vbep-lfrel EQ c_x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table i_vbfa1 into gwa_vbfa1&lt;/P&gt;&lt;P&gt;with key vbelv = gwa_vbep-vbeln&lt;/P&gt;&lt;P&gt;          posnv = gwa_vbep-posnr&lt;/P&gt;&lt;P&gt;          vbtyp_n = c_j&lt;/P&gt;&lt;P&gt;          vbtyp_v = c_c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;Read table li_vbup1 into lwa_vbup1&lt;/P&gt;&lt;P&gt;       with key  vbeln = gwa_vbfa1-vbelv&lt;/P&gt;&lt;P&gt;                lfsta = c_c.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read table li_vbup into lwa_vbup&lt;/P&gt;&lt;P&gt;       with key gbsta = c_b.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read table li_vbup into lwa_vbup&lt;/P&gt;&lt;P&gt;       with key gbsta = c_a.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read table li_vbup into lwa_vbup&lt;/P&gt;&lt;P&gt;       with key gbsta = ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;gv_subrc = c_4.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;gv_subrc = c_4.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;gv_subrc = c_4.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;if gv_subrc ne c_4.&lt;/P&gt;&lt;P&gt;Read table li_vbup into lwa_vbup&lt;/P&gt;&lt;P&gt;       with key gbsta = c_c.&lt;/P&gt;&lt;P&gt;       if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;       gv_subrc = c_0.&lt;/P&gt;&lt;P&gt;       endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;if gv_subrc = c_4.&lt;/P&gt;&lt;P&gt;  sy-subrc = c_4.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;  sy-subrc = c_0.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;sy-subrc = 0.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;error processing&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;issue an error message u2013 item is already fully invoiced&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;PERFORM VBFS_HINZUFUEGEN USING VBAP-POSNR '147' SPACE SPACE SPACE.&lt;/P&gt;&lt;P&gt;Sy-subrc = c_4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if sy-subrc ne c_0.&lt;/P&gt;&lt;P&gt;        sy-subrc = c_4.&lt;/P&gt;&lt;P&gt;        gv_subrc = sy-subrc.&lt;/P&gt;&lt;P&gt;        gv_vbeln2 = gwa_vbep-posnr.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Start of Addition on 01/08/05 - Request DD1K902189&lt;/P&gt;&lt;/LI&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;End of Addition on 01/08/05 - Request DD1K902189&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;  if gv_subrc eq c_4.&lt;/P&gt;&lt;P&gt;    concatenate c_text1 gv_vbeln2 c_text2 into gv_text&lt;/P&gt;&lt;P&gt;    separated by space.&lt;/P&gt;&lt;P&gt;    perform vbfs_hinzufuegen_allg using vbap-vbeln vbap-posnr 'VF' 'W'&lt;/P&gt;&lt;P&gt;                                        '801'gv_text space space space.&lt;/P&gt;&lt;P&gt;    sy-subrc = gv_subrc.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;End of code insertion for additional check from routine 900.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Start of Addition on 01/08/05 - Request DD1K902189&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Donot Invoice if it is a Contracted Item&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  if vbap-zseno = c_x.&lt;/P&gt;&lt;P&gt;  sy-subrc = 4.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;End of Addition on 01/08/05 - Request DD1K902189&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    "BEDINGUNG_PRUEFEN_928&lt;/P&gt;&lt;P&gt;*eject&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Indranil Biswas&lt;/P&gt;&lt;P&gt;Telephone: 080-66577777&lt;/P&gt;&lt;P&gt;Mobile: 9886465452&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2009 08:48:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-vofm/m-p/5557552#M1268329</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-18T08:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: problem with VOFM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-vofm/m-p/5557553#M1268330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is very difficult to view at the code you have written. But one thing I can you suggest you is, code accordingly that if the quantity is zero, make the sy-subrc to 4. &lt;/P&gt;&lt;P&gt;If it is VOFM routine, then make it to mandatory condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also check the code availble in the routine which is used at item level in the copying control.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santhosh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2009 09:10:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-vofm/m-p/5557553#M1268330</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-18T09:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: problem with VOFM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-vofm/m-p/5557554#M1268331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thnx for the reply i have sent thios mail to your id.can you tell where exactlyi put the sy-subrc=0?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2009 09:40:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-vofm/m-p/5557554#M1268331</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-18T09:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: problem with VOFM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-vofm/m-p/5557555#M1268332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By looking at the code, I can not directly tell where exactly the code needs to be modified.&lt;/P&gt;&lt;P&gt;But, in the internal table, in debugging you can check, and try deleting the entries from the internal table itself if the quantities is zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it works, then code accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santhosh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2009 10:20:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-vofm/m-p/5557555#M1268332</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-18T10:20:35Z</dc:date>
    </item>
  </channel>
</rss>

