<?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 Adding mutliple condition on creating idoc segment in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-mutliple-condition-on-creating-idoc-segment/m-p/12146442#M1976572</link>
    <description>&lt;P&gt;Hello, my issue today is that I made a program that Add ETD date in IDOC ORDRSP.&lt;/P&gt;
  &lt;P&gt;My question is how to I add new condition base on MESTYP, MESCOD and MESFCT before addind the segment.&lt;/P&gt;
  &lt;P&gt;I put the condition in comment in my code below, I still dont know how to kae it up.&lt;/P&gt;
  &lt;P&gt;Than you for your help.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;FORM f999_e1edp03_date_otm
 TABLES p_int_edidd STRUCTURE edidd
 p_dxvbpa STRUCTURE vbpa
 p_dxvbap STRUCTURE vbap
 p_dxvbep STRUCTURE vbep
 p_dxvbkd STRUCTURE vbkd
 p_dikomv STRUCTURE komv
 p_dikomvd STRUCTURE komvd
 USING p_dxvbak TYPE vbak
 p_dxhvbkd TYPE vbkd
 p_dobject TYPE nast.
 DATA : lw_E1EDP03 TYPE E1EDP03,
 lw_E1EDP01 TYPE E1EDP01,
 lw_edidd TYPE edidd,
* lw_zza68 TYPE ZZA68,
 l_zzimbd TYPE Char10,
 l_zzimbd_int TYPE VBAP-ZZIMBD,"material delivery date
 l_tabix TYPE sy-index,
 w_tabix TYPE sy-tabix.
 "get requested material delivery date zzimbd
 "filter on E1EDP01-werks
 Data : lr_werks type range of werks.
 IF p_int_edidd-segnam = 'E1EDP01'.
 MOVE p_int_edidd-sdata TO lw_e1edp01.
 " determine if new segment E1EDP03 must be added or not...
 " ...in function of plant value E1EDP01-WERKS
 " get Werks for which treatment is restricted


* Condition for adding segment:
* lw_zza68-MESTYP = 'ORDRSP'.
* lw_zza68-MESCOD = '037'.
* lw_zza68-MESFCT = 'CRE'.


 Select sign
 opti
 low
 high
 From TVARVC Into TABLE lr_werks
 Where name = 'ZZB_ZZB2I449_WERKS'
 And type = 'S'.
 If sy-subrc = 0 and lw_e1edp01-werks in lr_werks.
 " flag to inform new segment E1EDP03 with EDT need to be added.
 f_spec03 = 'X'.
 Endif.
* ENDIF.
 Endif.
 IF p_int_edidd-segnam = 'E1EDP03' AND f_spec03 = 'X'.
 " addition of new date segment
 CLEAR lw_e1edp03.
 CLEAR f_spec03.
 lw_e1edp03-iddat = 'ETD'.
 lw_e1edp03-datum = p_dxvbap-ZZIMBD.
 MOVE lw_e1edp03 TO p_int_edidd-sdata.
 APPEND p_int_edidd.
 ENDIF.
ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 15 Jan 2020 15:37:52 GMT</pubDate>
    <dc:creator>former_member343682</dc:creator>
    <dc:date>2020-01-15T15:37:52Z</dc:date>
    <item>
      <title>Adding mutliple condition on creating idoc segment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-mutliple-condition-on-creating-idoc-segment/m-p/12146442#M1976572</link>
      <description>&lt;P&gt;Hello, my issue today is that I made a program that Add ETD date in IDOC ORDRSP.&lt;/P&gt;
  &lt;P&gt;My question is how to I add new condition base on MESTYP, MESCOD and MESFCT before addind the segment.&lt;/P&gt;
  &lt;P&gt;I put the condition in comment in my code below, I still dont know how to kae it up.&lt;/P&gt;
  &lt;P&gt;Than you for your help.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;FORM f999_e1edp03_date_otm
 TABLES p_int_edidd STRUCTURE edidd
 p_dxvbpa STRUCTURE vbpa
 p_dxvbap STRUCTURE vbap
 p_dxvbep STRUCTURE vbep
 p_dxvbkd STRUCTURE vbkd
 p_dikomv STRUCTURE komv
 p_dikomvd STRUCTURE komvd
 USING p_dxvbak TYPE vbak
 p_dxhvbkd TYPE vbkd
 p_dobject TYPE nast.
 DATA : lw_E1EDP03 TYPE E1EDP03,
 lw_E1EDP01 TYPE E1EDP01,
 lw_edidd TYPE edidd,
* lw_zza68 TYPE ZZA68,
 l_zzimbd TYPE Char10,
 l_zzimbd_int TYPE VBAP-ZZIMBD,"material delivery date
 l_tabix TYPE sy-index,
 w_tabix TYPE sy-tabix.
 "get requested material delivery date zzimbd
 "filter on E1EDP01-werks
 Data : lr_werks type range of werks.
 IF p_int_edidd-segnam = 'E1EDP01'.
 MOVE p_int_edidd-sdata TO lw_e1edp01.
 " determine if new segment E1EDP03 must be added or not...
 " ...in function of plant value E1EDP01-WERKS
 " get Werks for which treatment is restricted


* Condition for adding segment:
* lw_zza68-MESTYP = 'ORDRSP'.
* lw_zza68-MESCOD = '037'.
* lw_zza68-MESFCT = 'CRE'.


 Select sign
 opti
 low
 high
 From TVARVC Into TABLE lr_werks
 Where name = 'ZZB_ZZB2I449_WERKS'
 And type = 'S'.
 If sy-subrc = 0 and lw_e1edp01-werks in lr_werks.
 " flag to inform new segment E1EDP03 with EDT need to be added.
 f_spec03 = 'X'.
 Endif.
* ENDIF.
 Endif.
 IF p_int_edidd-segnam = 'E1EDP03' AND f_spec03 = 'X'.
 " addition of new date segment
 CLEAR lw_e1edp03.
 CLEAR f_spec03.
 lw_e1edp03-iddat = 'ETD'.
 lw_e1edp03-datum = p_dxvbap-ZZIMBD.
 MOVE lw_e1edp03 TO p_int_edidd-sdata.
 APPEND p_int_edidd.
 ENDIF.
ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Jan 2020 15:37:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-mutliple-condition-on-creating-idoc-segment/m-p/12146442#M1976572</guid>
      <dc:creator>former_member343682</dc:creator>
      <dc:date>2020-01-15T15:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Adding mutliple condition on creating idoc segment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-mutliple-condition-on-creating-idoc-segment/m-p/12146443#M1976573</link>
      <description>&lt;P&gt;Could you explain the context, what calls your custom code?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 17:54:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-mutliple-condition-on-creating-idoc-segment/m-p/12146443#M1976573</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-01-15T17:54:51Z</dc:date>
    </item>
  </channel>
</rss>

