Skip to Content
author's profile photo Former Member
Former Member

FOX code question

Hi

I have quick question about VARV, VARC and VARI statements in FOX code.

I have characteristics called PPN and it has three counding objects OBJ1, OBJ2 and OBJ3.

Now I have created a exit variable for PPN and that variable is multiple selection that gives me multiple values. Variable works OK.

I wish to use these values into the fox code so I am written following code to read each value .Name of the variable is ZCL_PN. For some reason it doesnot work

Can someone help to identify what is the issue?

Thanks

DATA PPN TYPE ZFCSTPPN.

DATA PPNVAR TYPE ZFCSTPPN.

DATA TOTALCOUNT TYPE F.

DATA COUNT TYPE F.

PPN = VARV(ZCL_PN).

TOTALCOUNT= VARC(ZCL_PN).

COUNT = 1.

DO .

IF COUNT < TOTALCOUNT.

PPNVAR = VARI( ZCL_PN, COUNT ).

FOREACH SORG,SCHN,PPN.

***LOGIC HERE

ENDFOR.

COUNT = COUNT + 1.

ENDIF.

ENDDO.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 01, 2007 at 10:08 AM

    Hi,

    What is the exact problem you are having?

    The statement PPN = VARV(ZCL_PN) is not correct because VARV is used for reading value of single value variable.

    And are you sure you want two loops (FOREACH and DO) on PPN?

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 12:30 PM

    Hi

    Can you do following:

    <u><b>DATA PPN TYPE ZFCSTPPN. **Comment this line.</b></u>

    DATA PPNVAR TYPE ZFCSTPPN.

    DATA TOTALCOUNT TYPE F.

    DATA COUNT TYPE F.

    <u><b>PPN = VARV(ZCL_PN). ** Comment this line.</b></u>

    TOTALCOUNT= VARC(ZCL_PN).

    COUNT = 1.

    DO .

    IF COUNT < TOTALCOUNT.

    PPNVAR = VARI( ZCL_PN, COUNT ).

    FOREACH SORG,SCHN.

    <u><b>** Please use PPNVAR in the LOGIC</b></u>

    <u><b>** Try Removing PPNVAR from the FOREACH line</b></u>

    ***LOGIC HERE

    ENDFOR.

    COUNT = COUNT + 1.

    ENDIF.

    ENDDO.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.