<?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 va02 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/va02/m-p/2115311#M442683</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello everyone, &lt;/P&gt;&lt;P&gt;I written one code below.........but im not sure this one is correct,......anyone can send me the sample programs done with alternatives BOM's..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my probleme here is i cant get the value of stlal in va01....where i got it in mv45afzb and imported to here in mv45afzz.....see my following code...and suggest me or give me some idea's...how can i resolve this problem...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; data : begin of it_fg_xvbap occurs 0.&lt;/P&gt;&lt;P&gt;          include structure xvbap.&lt;/P&gt;&lt;P&gt;  data : end of it_fg_xvbap.&lt;/P&gt;&lt;P&gt;  data : begin of it_fg_xvbep occurs 0.&lt;/P&gt;&lt;P&gt;          include structure xvbep.&lt;/P&gt;&lt;P&gt;  data : end of it_fg_xvbep.&lt;/P&gt;&lt;P&gt;  data: begin of it_zfreegoods occurs 0.&lt;/P&gt;&lt;P&gt;          include structure zfreegoods.&lt;/P&gt;&lt;P&gt;  data: end of it_zfreegoods.&lt;/P&gt;&lt;P&gt;  data: v_lines(3) type c,&lt;/P&gt;&lt;P&gt;        v_stas(3) type c,&lt;/P&gt;&lt;P&gt;        it_fg_index like sy-tabix.&lt;/P&gt;&lt;P&gt;  data: v_mitem1_qty like vbap-kwmeng,&lt;/P&gt;&lt;P&gt;        v_quantity like zfreegoods-quantity,&lt;/P&gt;&lt;P&gt;        v_newqty like zfreegoods-quantity,&lt;/P&gt;&lt;P&gt;        v_memid like indx-srtfd VALUE 'ZZBOM'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IMPORT cstmat FROM MEMORY ID v_memid .&lt;/P&gt;&lt;P&gt;  if not xvbap[] is initial.&lt;/P&gt;&lt;P&gt;    loop at xvbap where stlal = ' '.&lt;/P&gt;&lt;P&gt;      xvbap-stlal = cstmat-stlal.&lt;/P&gt;&lt;P&gt;      modify xvbap.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;  If sy-tcode = 'VA01' or sy-tcode = 'VA02'.&lt;/P&gt;&lt;P&gt;  it_fg_xvbap[] = xvbap[].&lt;/P&gt;&lt;P&gt;  if not it_fg_xvbap[] is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    read table it_fg_xvbap index 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    select * from zfreegoods into table it_zfreegoods&lt;/P&gt;&lt;P&gt;           for all entries in it_fg_xvbap&lt;/P&gt;&lt;P&gt;           where matnr eq it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check if the BOM is completely exploded for mix-match.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    if not it_zfreegoods[] is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      loop at it_fg_xvbap.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;If user selects Alternative BOM '04' MIX and MATCH concept with&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;quantity combinations 2-1,2-2,3-3,4-2 and 5-1.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        if it_fg_xvbap-stlal = '04'.&lt;/P&gt;&lt;P&gt;          read table it_zfreegoods with key matnr = it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;          if sy-subrc eq 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; This scenario triggers - min qty 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            if it_fg_xvbap-kwmeng &amp;lt;= '1.000'.&lt;/P&gt;&lt;P&gt;              it_fg_xvbap-kwmeng = '2.000'.&lt;/P&gt;&lt;P&gt;              it_fg_xvbap-lsmeng = it_fg_xvbap-kwmeng.&lt;/P&gt;&lt;P&gt;            endif.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; This scenario triggers - max qty 5&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            if it_fg_xvbap-kwmeng &amp;gt;= '6.000'.&lt;/P&gt;&lt;P&gt;              message s021(zsnd) with '6'.&lt;/P&gt;&lt;P&gt;              it_fg_xvbap-kwmeng = '5.000'.&lt;/P&gt;&lt;P&gt;              it_fg_xvbap-lsmeng = it_fg_xvbap-kwmeng.&lt;/P&gt;&lt;P&gt;            endif.&lt;/P&gt;&lt;P&gt;            v_mitem1_qty = it_fg_xvbap-kwmeng.&lt;/P&gt;&lt;P&gt;            v_quantity = it_zfreegoods-quantity.&lt;/P&gt;&lt;P&gt;            modify it_fg_xvbap.&lt;/P&gt;&lt;P&gt;            clear v_lines.&lt;/P&gt;&lt;P&gt;            continue.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          if it_zfreegoods-matnr ne it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;            it_fg_xvbap-kwmeng = it_fg_xvbap-kmpmg.&lt;/P&gt;&lt;P&gt;            it_fg_xvbap-lsmeng = it_fg_xvbap-kmpmg.&lt;/P&gt;&lt;P&gt;            modify it_fg_xvbap.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          v_lines = v_lines + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          if it_zfreegoods-zfreemodel eq it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;            if v_mitem1_qty &amp;lt;= v_quantity.&lt;/P&gt;&lt;P&gt;              v_newqty = v_quantity - v_mitem1_qty.&lt;/P&gt;&lt;P&gt;              it_fg_xvbap-kwmeng = v_newqty.&lt;/P&gt;&lt;P&gt;              it_fg_xvbap-lsmeng = v_newqty.&lt;/P&gt;&lt;P&gt;              modify it_fg_xvbap.&lt;/P&gt;&lt;P&gt;            else.&lt;/P&gt;&lt;P&gt;              if fcode eq 'SICH'.&lt;/P&gt;&lt;P&gt;                message e020(zsnd) with it_zfreegoods-quantity .&lt;/P&gt;&lt;P&gt;              else.&lt;/P&gt;&lt;P&gt;                message s020(zsnd) with it_zfreegoods-quantity .&lt;/P&gt;&lt;P&gt;              endif.&lt;/P&gt;&lt;P&gt;            endif.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;        endif.   " it_fg_xvbap-stlal '04'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;If user selects Alternative BOM '03'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        if it_fg_xvbap-stlal = '03'.&lt;/P&gt;&lt;P&gt;          read table it_zfreegoods with key matnr = it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          if it_zfreegoods-matnr ne it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;            it_fg_xvbap-kwmeng = it_fg_xvbap-kmpmg.&lt;/P&gt;&lt;P&gt;            it_fg_xvbap-lsmeng = it_fg_xvbap-kmpmg.&lt;/P&gt;&lt;P&gt;            modify it_fg_xvbap.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;          if it_zfreegoods-zfreemodel eq it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;            it_fg_xvbap-kwmeng = it_fg_xvbap-kmpmg.&lt;/P&gt;&lt;P&gt;            it_fg_xvbap-lsmeng = it_fg_xvbap-kmpmg.&lt;/P&gt;&lt;P&gt;            modify it_fg_xvbap.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;        endif.   " it_fg_xvbap-stlal '03'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;If user selects Alternative BOM '02'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        if it_fg_xvbap-stlal = '02'.&lt;/P&gt;&lt;P&gt;          read table it_zfreegoods with key matnr = it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          if it_zfreegoods-matnr ne it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;            it_fg_xvbap-kwmeng = it_fg_xvbap-kmpmg.&lt;/P&gt;&lt;P&gt;            it_fg_xvbap-lsmeng = it_fg_xvbap-kmpmg.&lt;/P&gt;&lt;P&gt;            modify it_fg_xvbap.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;        endif.   " it_fg_xvbap-stlal '02'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;If user selects Alternative BOM '01'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        if it_fg_xvbap-stlal = '01'.&lt;/P&gt;&lt;P&gt;          read table it_zfreegoods with key matnr = it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          if it_zfreegoods-matnr ne it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;            it_fg_xvbap-kwmeng = it_fg_xvbap-kmpmg.&lt;/P&gt;&lt;P&gt;            it_fg_xvbap-lsmeng = it_fg_xvbap-kmpmg.&lt;/P&gt;&lt;P&gt;            modify it_fg_xvbap.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;        endif.   " it_fg_xvbap-stlal '01'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if not xvbep[] is initial.&lt;/P&gt;&lt;P&gt;        it_fg_xvbep[]  =  xvbep[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        loop at it_fg_xvbep.&lt;/P&gt;&lt;P&gt;          clear it_fg_xvbap.&lt;/P&gt;&lt;P&gt;          read table it_fg_xvbap with key posnr = it_fg_xvbep-posnr.&lt;/P&gt;&lt;P&gt;          if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;            it_fg_index = sy-tabix.&lt;/P&gt;&lt;P&gt;            it_fg_xvbep-wmeng = it_fg_xvbap-kwmeng.&lt;/P&gt;&lt;P&gt;            it_fg_xvbep-bmeng = it_fg_xvbap-kwmeng.&lt;/P&gt;&lt;P&gt;            it_fg_xvbep-lmeng = it_fg_xvbap-kwmeng.&lt;/P&gt;&lt;P&gt;            it_fg_xvbep-cmeng = it_fg_xvbap-kwmeng.&lt;/P&gt;&lt;P&gt;            modify it_fg_xvbep index it_fg_index.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;        endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        xvbep[] = it_fg_xvbep[].&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;      xvbap[] = it_fg_xvbap[].&lt;/P&gt;&lt;P&gt;    endif.   "  it_zfreegoods table&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;  free memory id v_memid.&lt;/P&gt;&lt;P&gt;  endif. "end if va01 and va02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Apr 2007 22:05:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-05T22:05:38Z</dc:date>
    <item>
      <title>va02</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/va02/m-p/2115311#M442683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello everyone, &lt;/P&gt;&lt;P&gt;I written one code below.........but im not sure this one is correct,......anyone can send me the sample programs done with alternatives BOM's..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my probleme here is i cant get the value of stlal in va01....where i got it in mv45afzb and imported to here in mv45afzz.....see my following code...and suggest me or give me some idea's...how can i resolve this problem...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; data : begin of it_fg_xvbap occurs 0.&lt;/P&gt;&lt;P&gt;          include structure xvbap.&lt;/P&gt;&lt;P&gt;  data : end of it_fg_xvbap.&lt;/P&gt;&lt;P&gt;  data : begin of it_fg_xvbep occurs 0.&lt;/P&gt;&lt;P&gt;          include structure xvbep.&lt;/P&gt;&lt;P&gt;  data : end of it_fg_xvbep.&lt;/P&gt;&lt;P&gt;  data: begin of it_zfreegoods occurs 0.&lt;/P&gt;&lt;P&gt;          include structure zfreegoods.&lt;/P&gt;&lt;P&gt;  data: end of it_zfreegoods.&lt;/P&gt;&lt;P&gt;  data: v_lines(3) type c,&lt;/P&gt;&lt;P&gt;        v_stas(3) type c,&lt;/P&gt;&lt;P&gt;        it_fg_index like sy-tabix.&lt;/P&gt;&lt;P&gt;  data: v_mitem1_qty like vbap-kwmeng,&lt;/P&gt;&lt;P&gt;        v_quantity like zfreegoods-quantity,&lt;/P&gt;&lt;P&gt;        v_newqty like zfreegoods-quantity,&lt;/P&gt;&lt;P&gt;        v_memid like indx-srtfd VALUE 'ZZBOM'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IMPORT cstmat FROM MEMORY ID v_memid .&lt;/P&gt;&lt;P&gt;  if not xvbap[] is initial.&lt;/P&gt;&lt;P&gt;    loop at xvbap where stlal = ' '.&lt;/P&gt;&lt;P&gt;      xvbap-stlal = cstmat-stlal.&lt;/P&gt;&lt;P&gt;      modify xvbap.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;  If sy-tcode = 'VA01' or sy-tcode = 'VA02'.&lt;/P&gt;&lt;P&gt;  it_fg_xvbap[] = xvbap[].&lt;/P&gt;&lt;P&gt;  if not it_fg_xvbap[] is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    read table it_fg_xvbap index 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    select * from zfreegoods into table it_zfreegoods&lt;/P&gt;&lt;P&gt;           for all entries in it_fg_xvbap&lt;/P&gt;&lt;P&gt;           where matnr eq it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check if the BOM is completely exploded for mix-match.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    if not it_zfreegoods[] is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      loop at it_fg_xvbap.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;If user selects Alternative BOM '04' MIX and MATCH concept with&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;quantity combinations 2-1,2-2,3-3,4-2 and 5-1.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        if it_fg_xvbap-stlal = '04'.&lt;/P&gt;&lt;P&gt;          read table it_zfreegoods with key matnr = it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;          if sy-subrc eq 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; This scenario triggers - min qty 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            if it_fg_xvbap-kwmeng &amp;lt;= '1.000'.&lt;/P&gt;&lt;P&gt;              it_fg_xvbap-kwmeng = '2.000'.&lt;/P&gt;&lt;P&gt;              it_fg_xvbap-lsmeng = it_fg_xvbap-kwmeng.&lt;/P&gt;&lt;P&gt;            endif.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; This scenario triggers - max qty 5&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            if it_fg_xvbap-kwmeng &amp;gt;= '6.000'.&lt;/P&gt;&lt;P&gt;              message s021(zsnd) with '6'.&lt;/P&gt;&lt;P&gt;              it_fg_xvbap-kwmeng = '5.000'.&lt;/P&gt;&lt;P&gt;              it_fg_xvbap-lsmeng = it_fg_xvbap-kwmeng.&lt;/P&gt;&lt;P&gt;            endif.&lt;/P&gt;&lt;P&gt;            v_mitem1_qty = it_fg_xvbap-kwmeng.&lt;/P&gt;&lt;P&gt;            v_quantity = it_zfreegoods-quantity.&lt;/P&gt;&lt;P&gt;            modify it_fg_xvbap.&lt;/P&gt;&lt;P&gt;            clear v_lines.&lt;/P&gt;&lt;P&gt;            continue.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          if it_zfreegoods-matnr ne it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;            it_fg_xvbap-kwmeng = it_fg_xvbap-kmpmg.&lt;/P&gt;&lt;P&gt;            it_fg_xvbap-lsmeng = it_fg_xvbap-kmpmg.&lt;/P&gt;&lt;P&gt;            modify it_fg_xvbap.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          v_lines = v_lines + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          if it_zfreegoods-zfreemodel eq it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;            if v_mitem1_qty &amp;lt;= v_quantity.&lt;/P&gt;&lt;P&gt;              v_newqty = v_quantity - v_mitem1_qty.&lt;/P&gt;&lt;P&gt;              it_fg_xvbap-kwmeng = v_newqty.&lt;/P&gt;&lt;P&gt;              it_fg_xvbap-lsmeng = v_newqty.&lt;/P&gt;&lt;P&gt;              modify it_fg_xvbap.&lt;/P&gt;&lt;P&gt;            else.&lt;/P&gt;&lt;P&gt;              if fcode eq 'SICH'.&lt;/P&gt;&lt;P&gt;                message e020(zsnd) with it_zfreegoods-quantity .&lt;/P&gt;&lt;P&gt;              else.&lt;/P&gt;&lt;P&gt;                message s020(zsnd) with it_zfreegoods-quantity .&lt;/P&gt;&lt;P&gt;              endif.&lt;/P&gt;&lt;P&gt;            endif.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;        endif.   " it_fg_xvbap-stlal '04'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;If user selects Alternative BOM '03'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        if it_fg_xvbap-stlal = '03'.&lt;/P&gt;&lt;P&gt;          read table it_zfreegoods with key matnr = it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          if it_zfreegoods-matnr ne it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;            it_fg_xvbap-kwmeng = it_fg_xvbap-kmpmg.&lt;/P&gt;&lt;P&gt;            it_fg_xvbap-lsmeng = it_fg_xvbap-kmpmg.&lt;/P&gt;&lt;P&gt;            modify it_fg_xvbap.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;          if it_zfreegoods-zfreemodel eq it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;            it_fg_xvbap-kwmeng = it_fg_xvbap-kmpmg.&lt;/P&gt;&lt;P&gt;            it_fg_xvbap-lsmeng = it_fg_xvbap-kmpmg.&lt;/P&gt;&lt;P&gt;            modify it_fg_xvbap.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;        endif.   " it_fg_xvbap-stlal '03'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;If user selects Alternative BOM '02'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        if it_fg_xvbap-stlal = '02'.&lt;/P&gt;&lt;P&gt;          read table it_zfreegoods with key matnr = it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          if it_zfreegoods-matnr ne it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;            it_fg_xvbap-kwmeng = it_fg_xvbap-kmpmg.&lt;/P&gt;&lt;P&gt;            it_fg_xvbap-lsmeng = it_fg_xvbap-kmpmg.&lt;/P&gt;&lt;P&gt;            modify it_fg_xvbap.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;        endif.   " it_fg_xvbap-stlal '02'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;If user selects Alternative BOM '01'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        if it_fg_xvbap-stlal = '01'.&lt;/P&gt;&lt;P&gt;          read table it_zfreegoods with key matnr = it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          if it_zfreegoods-matnr ne it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;            it_fg_xvbap-kwmeng = it_fg_xvbap-kmpmg.&lt;/P&gt;&lt;P&gt;            it_fg_xvbap-lsmeng = it_fg_xvbap-kmpmg.&lt;/P&gt;&lt;P&gt;            modify it_fg_xvbap.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;        endif.   " it_fg_xvbap-stlal '01'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if not xvbep[] is initial.&lt;/P&gt;&lt;P&gt;        it_fg_xvbep[]  =  xvbep[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        loop at it_fg_xvbep.&lt;/P&gt;&lt;P&gt;          clear it_fg_xvbap.&lt;/P&gt;&lt;P&gt;          read table it_fg_xvbap with key posnr = it_fg_xvbep-posnr.&lt;/P&gt;&lt;P&gt;          if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;            it_fg_index = sy-tabix.&lt;/P&gt;&lt;P&gt;            it_fg_xvbep-wmeng = it_fg_xvbap-kwmeng.&lt;/P&gt;&lt;P&gt;            it_fg_xvbep-bmeng = it_fg_xvbap-kwmeng.&lt;/P&gt;&lt;P&gt;            it_fg_xvbep-lmeng = it_fg_xvbap-kwmeng.&lt;/P&gt;&lt;P&gt;            it_fg_xvbep-cmeng = it_fg_xvbap-kwmeng.&lt;/P&gt;&lt;P&gt;            modify it_fg_xvbep index it_fg_index.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;        endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        xvbep[] = it_fg_xvbep[].&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;      xvbap[] = it_fg_xvbap[].&lt;/P&gt;&lt;P&gt;    endif.   "  it_zfreegoods table&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;  free memory id v_memid.&lt;/P&gt;&lt;P&gt;  endif. "end if va01 and va02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2007 22:05:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/va02/m-p/2115311#M442683</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-05T22:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: va02</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/va02/m-p/2115312#M442684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please explain more about the functionality of the report and what exactly you wanted to do, may be business process behind the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2007 22:13:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/va02/m-p/2115312#M442684</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-05T22:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: va02</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/va02/m-p/2115313#M442685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are importing from memory, where are you exporting it? Probably there is nothing in this import.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMPORT cstmat FROM MEMORY ID v_memid .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2007 22:24:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/va02/m-p/2115313#M442685</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-05T22:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: va02</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/va02/m-p/2115314#M442686</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;Please try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
In program MV45AFZB.


...
data: v_stlal1 like cstmat-stlal.
 
v_stlal1 = cstmat-stlal.
export v_statl1 to memory id 'STLAL'.
... 





In program MV45AFZZ. 


...
data: v_stlal2 like cstmat-stlal.
 
import v_stlal2 from memory id 'STLAL'.

if not xvbap[] is initial.
  loop at xvbap where stlal = ' '.
    xvbap-stlal = v_stlal2.
    modify xvbap.
  endloop.

...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2007 22:49:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/va02/m-p/2115314#M442686</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-05T22:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: va02</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/va02/m-p/2115315#M442687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi FERRY LIANTO,&lt;/P&gt;&lt;P&gt;I did what exactly u told me........i got the requirement by using it(everything is good..when i did in VA01) once i need to change the document in VA02 then all the stlal entires in xvbap will gone.....because...cstmat-stlal is empty when it is in VA02.....that time(changing document) problem is coming...my code is not working in mv45afzz..........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for this i have another solution.....can u help me how i can do it....&lt;/P&gt;&lt;P&gt;I created a custom table and zfreegoods...its already in the code...so in that if i send values of stlal....by useing that i can write the code write.....can u help me out how can i write the code and all.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2007 00:35:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/va02/m-p/2115315#M442687</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-06T00:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: va02</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/va02/m-p/2115316#M442688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI AMREY,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my requirement is BOM When I am creating sales order.  everything is fine I configured the material in CSO1 what I want......here actual requirement is ...there is 4 types of BOM's. if the user selects these 4 BOM's ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BOM1- material1 with mat-Item1 with same quantity&lt;/P&gt;&lt;P&gt;BOM2- material1 with mat-Item1, mat-Item2, mat-Item3 with different quantity&lt;/P&gt;&lt;P&gt;BOM3- material1 with mat-Item1, mat-Item2, mat-Item3 and material2 with some quantity.&lt;/P&gt;&lt;P&gt;BOM4- material1 with mat-Item1, mat-Item2, mat-Item3 and material2 with MIX and Match quantity(material1 and material2 combination is 6 units.) If i give material1 with 2 quantity the material2 should be he quantity 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wrote the above code but still it like a hardcodeing ....so please send me the corrections or give me any other code how to write.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2007 00:44:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/va02/m-p/2115316#M442688</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-06T00:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: va02</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/va02/m-p/2115317#M442689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello srinivas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am exporting it from MV45AFZB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        madhu vishwanath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2007 00:45:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/va02/m-p/2115317#M442689</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-06T00:45:48Z</dc:date>
    </item>
  </channel>
</rss>

