Results 1 to 3 of 3

Thread: Read the F4211 with partial key within a C Function?

  1. #1
    New Member
    Join Date
    Dec 2017
    Posts
    34

    Read the F4211 with partial key within a C Function?

    Hello all,

    Have tried several methods to read data from the F4211 with data passed from another table. Everything I've tried has resulted in no data being read even though I know there is.....see code snippet below.... The F47071 returns correct data..

    The Key 1 for the F4211 is actually 4 fields, but I need to read just on Company, Order and Order Type.....So something with the SelectKeyed or Fetch on the F4211 is not correct.....

    Any ideas?

    Thank you,
    FrankCLT


    Code:
    HREQUEST          hReqF4211           =    (HREQUEST)NULL;
    NID               szTableID_F4211     =    NID_F4211;
    ID                idIndexF4211        =    ID_F4211_ORDER_NUMBER__ORDER_TYPE___A;

    Code:
     memset((void *)(&dsKey1), (int)(_J('\0')), sizeof(dsKey1));
     memset((void *)(&dsF4211), (int)(_J('\0')), sizeof(dsF4211));
    


    Code:
    JDEDBReturn = JDB_SelectKeyed(hReqF47071, (ID)0, (void *) NULL, (short)(0));
    
    while (JDEDBReturn == JDEDB_PASSED)
    {
         JDEDBReturn = JDB_Fetch(hReqF47071, (void *) &dsF47071, (int)0); 
         if (JDEDBReturn == JDEDB_PASSED)
          {
             jdeStrcpy((JCHAR *)(dsKey1.sdkcoo),(const JCHAR *)(dsF47071.syrkco));
             ParseNumericString(&dsKey1.sddoco, dsF47071.syrorn);
             jdeStrcpy((JCHAR *)(dsKey1.sddcto),(const JCHAR *)(dsF47071.syrcto));
    
             JDEDBReturn2 = JDB_SelectKeyed(hReqF4211, (ID)0, (void *) NULL, (short)(3));  
              while (JDEDBReturn2 == JDEDB_PASSED)
              {  
                JDEDBReturn2 = JDB_Fetch(hReqF4211,(void *) &dsF4211, FALSE);
                if (JDEDBReturn2 == JDEDB_PASSED)
                 {
                   lpDS->cRecordFound = _J('Y');
                 }
             } 
          }     
    } 
    


  2. #2
    Member craig_welton's Avatar
    Join Date
    Oct 2000
    Location
    Litchfield, CT
    Posts
    994
    You need to pass the key structure and index ID to JDB_SelectKeyed

    Code:
    JDEDBReturn = JDB_SelectKeyed(hReqF47071, (ID)0, (void *) NULL, (short)(0));
    
    while (JDEDBReturn == JDEDB_PASSED)
    {
          JDEDBReturn = JDB_Fetch(hReqF47071, (void *) &dsF47071, (int)0); 
          if (JDEDBReturn == JDEDB_PASSED)
          {
              jdeStrcpy((JCHAR *)(dsKey1.sdkcoo),(const JCHAR *)(dsF47071.syrkco));
              ParseNumericString(&dsKey1.sddoco, dsF47071.syrorn);
              jdeStrcpy((JCHAR *)(dsKey1.sddcto),(const JCHAR *)(dsF47071.syrcto));
    
             JDEDBReturn2 = JDB_SelectKeyed(hReqF4211, (ID)idIndexF4211, (void *)&dsKey1, (short)(3));  
    
              while (JDEDBReturn2 == JDEDB_PASSED)
              {  
                 JDEDBReturn2 = JDB_Fetch(hReqF4211,(void *) &dsF4211, FALSE);
                if (JDEDBReturn2 == JDEDB_PASSED)
                 {
                    lpDS->cRecordFound = _J('Y');
                 }
              } 
         }     
     } 
    
    Craig Welton
    PatWel Group Inc.
    http://www.patwel.com
    Home of the FREE JDE Object Browser, JDETrace, NERDup and BusBuild+ Tools

    E1 9.0 8.98.4.2 Wintel SQL 2008
    E1 9.2 9.2.1.4 iSeries

  3. #3
    New Member
    Join Date
    Dec 2017
    Posts
    34
    Stupid me......that worked.....Thank you...

    FrankCLT

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
The legal restrictions and terms of use applicable to this site are available here.
Use of this site signifies your agreement to the terms of use.
JDELIST is NOT affiliated with JD Edwards® & Company, Oracle or Peoplesoft. Contents of this site are neither endorsed nor approved by JD Edwards® & Company and, or Oracle.