<?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 Type-incompatible error occur when using 'DO - varying'. How to fix it? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-incompatible-error-occur-when-using-do-varying-how-to-fix-it/m-p/6543333#M1428390</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When i do my program, i meet an error message like this: " "FX01" and "VAR" are type-incompatible. ".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the following is part of my coding:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: FX1(36) VALUE 'MENGE MEINS DMBTR WAERS ERFMG ERFME WRBTR'.&lt;/P&gt;&lt;P&gt;  DATA: FX2(36) VALUE 'BPMNG BPRME BSTMG BSTME EXBWR VKWRT '.&lt;/P&gt;&lt;P&gt;  DATA: FX3(36) VALUE 'EXVKW VKWRA LSMNG LSMEH SHKZG $$$$$ '.&lt;/P&gt;&lt;P&gt;  DATA: VAR(6), NAME(20), TYPE.&lt;/P&gt;&lt;P&gt;  FIELD-SYMBOLS: &amp;lt;F&amp;gt;.&lt;/P&gt;&lt;P&gt;  DATA: COLOR      TYPE SLIS_T_SPECIALCOL_ALV WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;  DATA: BELEGE  TYPE BELEGTAB            OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DO VARYING VAR FROM FX1 NEXT FX1+6.&lt;/P&gt;&lt;P&gt;      IF VAR(1) = '$'. EXIT. ENDIF.&lt;/P&gt;&lt;P&gt;      CONCATENATE 'BELEGE-' VAR(5) INTO NAME.&lt;/P&gt;&lt;P&gt;      ASSIGN (NAME) TO &amp;lt;F&amp;gt;.&lt;/P&gt;&lt;P&gt;      COLOR-FIELDNAME = VAR.&lt;/P&gt;&lt;P&gt;      COLOR-COLOR-INT = 0.&lt;/P&gt;&lt;P&gt;      IF BELEGE-SHKZG = 'H'.&lt;/P&gt;&lt;P&gt;        DESCRIBE FIELD &amp;lt;F&amp;gt; TYPE TYPE.&lt;/P&gt;&lt;P&gt;        COLOR-COLOR-COL = '6'.&lt;/P&gt;&lt;P&gt;        APPEND COLOR.&lt;/P&gt;&lt;P&gt;      ELSEIF BELEGE-SHKZG = 'S'.&lt;/P&gt;&lt;P&gt;        COLOR-COLOR-COL = '5'.&lt;/P&gt;&lt;P&gt;        APPEND COLOR.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, does anyone have any idea about this?&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>Mon, 04 Jan 2010 11:10:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-01-04T11:10:00Z</dc:date>
    <item>
      <title>Type-incompatible error occur when using 'DO - varying'. How to fix it?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-incompatible-error-occur-when-using-do-varying-how-to-fix-it/m-p/6543333#M1428390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When i do my program, i meet an error message like this: " "FX01" and "VAR" are type-incompatible. ".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the following is part of my coding:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: FX1(36) VALUE 'MENGE MEINS DMBTR WAERS ERFMG ERFME WRBTR'.&lt;/P&gt;&lt;P&gt;  DATA: FX2(36) VALUE 'BPMNG BPRME BSTMG BSTME EXBWR VKWRT '.&lt;/P&gt;&lt;P&gt;  DATA: FX3(36) VALUE 'EXVKW VKWRA LSMNG LSMEH SHKZG $$$$$ '.&lt;/P&gt;&lt;P&gt;  DATA: VAR(6), NAME(20), TYPE.&lt;/P&gt;&lt;P&gt;  FIELD-SYMBOLS: &amp;lt;F&amp;gt;.&lt;/P&gt;&lt;P&gt;  DATA: COLOR      TYPE SLIS_T_SPECIALCOL_ALV WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;  DATA: BELEGE  TYPE BELEGTAB            OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DO VARYING VAR FROM FX1 NEXT FX1+6.&lt;/P&gt;&lt;P&gt;      IF VAR(1) = '$'. EXIT. ENDIF.&lt;/P&gt;&lt;P&gt;      CONCATENATE 'BELEGE-' VAR(5) INTO NAME.&lt;/P&gt;&lt;P&gt;      ASSIGN (NAME) TO &amp;lt;F&amp;gt;.&lt;/P&gt;&lt;P&gt;      COLOR-FIELDNAME = VAR.&lt;/P&gt;&lt;P&gt;      COLOR-COLOR-INT = 0.&lt;/P&gt;&lt;P&gt;      IF BELEGE-SHKZG = 'H'.&lt;/P&gt;&lt;P&gt;        DESCRIBE FIELD &amp;lt;F&amp;gt; TYPE TYPE.&lt;/P&gt;&lt;P&gt;        COLOR-COLOR-COL = '6'.&lt;/P&gt;&lt;P&gt;        APPEND COLOR.&lt;/P&gt;&lt;P&gt;      ELSEIF BELEGE-SHKZG = 'S'.&lt;/P&gt;&lt;P&gt;        COLOR-COLOR-COL = '5'.&lt;/P&gt;&lt;P&gt;        APPEND COLOR.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, does anyone have any idea about this?&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>Mon, 04 Jan 2010 11:10:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-incompatible-error-occur-when-using-do-varying-how-to-fix-it/m-p/6543333#M1428390</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-04T11:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: Type-incompatible error occur when using 'DO - varying'. How to fix it?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-incompatible-error-occur-when-using-do-varying-how-to-fix-it/m-p/6543334#M1428391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;dont know your exact requirement but see..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a varying syntax would be like :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;DO  VARYING VAR FROM FX1(1) NEXT FX1+6(1) RANGE fx1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here VAR has to be of type char1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2010 11:32:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-incompatible-error-occur-when-using-do-varying-how-to-fix-it/m-p/6543334#M1428391</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-04T11:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: Type-incompatible error occur when using 'DO - varying'. How to fix it?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-incompatible-error-occur-when-using-do-varying-how-to-fix-it/m-p/6543335#M1428392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;complete code should be:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPE-POOLS: imrep, slis.

TYPES: BEGIN OF mseg_typ.
INCLUDE TYPE imrep_matbeleg_typ.
TYPES: END OF mseg_typ.

TYPES: BEGIN OF belegtab.
INCLUDE TYPE mseg_typ.
TYPES: END OF belegtab.

DATA: color TYPE slis_t_specialcol_alv WITH HEADER LINE.
DATA: belege TYPE belegtab OCCURS 0 WITH HEADER LINE.

DATA: fx1(36) VALUE 'MENGE MEINS DMBTR WAERS ERFMG ERFME WRBTR'.
DATA: fx2(36) VALUE 'BPMNG BPRME BSTMG BSTME EXBWR VKWRT '.
DATA: fx3(36) VALUE 'EXVKW VKWRA LSMNG LSMEH SHKZG $$$$$ '.
DATA: var(6), name(20), type.

FIELD-SYMBOLS: &amp;lt;f&amp;gt;.

DO VARYING var FROM fx1 NEXT fx1+6.
  IF var(1) = '$'. EXIT. ENDIF.
  CONCATENATE 'BELEGE-' var(5) INTO name.
  ASSIGN (name) TO &amp;lt;f&amp;gt;.
  color-fieldname = var.
  color-color-int = 0.
  IF belege-shkzg = 'H'.
    DESCRIBE FIELD &amp;lt;f&amp;gt; TYPE type.
    color-color-col = '6'.
    APPEND color.
  ELSEIF belege-shkzg = 'S'.
    color-color-col = '5'.
    APPEND color.
  ENDIF.
ENDDO.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code Formatted by: Alvaro Tejada Galindo on Jan 4, 2010 3:53 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2010 11:37:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-incompatible-error-occur-when-using-do-varying-how-to-fix-it/m-p/6543335#M1428392</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-04T11:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Type-incompatible error occur when using 'DO - varying'. How to fix it?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-incompatible-error-occur-when-using-do-varying-how-to-fix-it/m-p/6543336#M1428393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jiansi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just modify slightly the statement to, and it will work. I just now tried.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

DO 10 times VARYING VAR FROM FX1(6) NEXT FX1+6(6)  range fx1.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : You may  have to determine the number of times.. I have taken 10 for example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit Mittal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2010 11:41:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-incompatible-error-occur-when-using-do-varying-how-to-fix-it/m-p/6543336#M1428393</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-04T11:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Type-incompatible error occur when using 'DO - varying'. How to fix it?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-incompatible-error-occur-when-using-do-varying-how-to-fix-it/m-p/6543337#M1428394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jainsi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change the Do statement liek this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DO VARYING var FROM fx1(6) NEXT fx1+6(6) RANGE fx1.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FYI,  Do Varying statement has been marked as obsolete control structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Swarna Munukoti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2010 11:59:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-incompatible-error-occur-when-using-do-varying-how-to-fix-it/m-p/6543337#M1428394</guid>
      <dc:creator>former_member217544</dc:creator>
      <dc:date>2010-01-04T11:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Type-incompatible error occur when using 'DO - varying'. How to fix it?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-incompatible-error-occur-when-using-do-varying-how-to-fix-it/m-p/6543338#M1428395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this. done use obsolete codes..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: fx1(36) VALUE 'MENGE MEINS DMBTR WAERS ERFMG ERFME'.
*DATA: var(6), name(20), type.
DATA: result_tab TYPE match_result_tab.
data: len type i, den type i.
FIELD-SYMBOLS: &amp;lt;f&amp;gt;.
"find ALL OCCURRENCES OF ` ` in fx1 RESULTS result_tab.
"describe table result_tab lines den.
DO." den times. 
  len = len + 6.
  ASSIGN fx1+len(6) TO &amp;lt;f&amp;gt;.
  if &amp;lt;f&amp;gt; is ASSIGNED.
  WRITE:/ &amp;lt;f&amp;gt;.
  else.
    exit.
  endif.
ENDDO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the commented code can be kept or removed..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2010 12:04:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-incompatible-error-occur-when-using-do-varying-how-to-fix-it/m-p/6543338#M1428395</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-04T12:04:52Z</dc:date>
    </item>
  </channel>
</rss>

