Results 1 to 7 of 7

Thread: JDEDM_LoadDSfromDS

  1. #1

    JDEDM_LoadDSfromDS

    I'm trying to create F47011/12 records from F4201/F4211.

    Being lazy - I thought I'd copy most of the fields with the following:


    JDEDM_LoadDSfromDS( (HUSER)hUser, _J("F4201"),
    (LPVOID)lpdsF4201,
    _J("F47011"),
    (LPVOID)lpdsF47011,
    JDEDM_MATCHINGBY_DD);


    But it gives me a memory error. I'm guessing it only works on JDE data structures??? (clue is in the name...)



    E8.11/E9.2

  2. #2
    I found these 2 apis on JDESource (thanks)


    JDEDM_LoadDSfromTableRecord
    JDEDM_LoadTableRecordfromDS


    However it still looks like I might need to create a DS that matches either the source or destination table.


    I could roll my own code - coping alot of the column mappings from B4201540.


    Does anyone have a more intellegent way of doing it?

  3. #3
    Member
    Join Date
    Mar 2002
    Location
    Minneapolis, MN
    Posts
    775
    How are you defining lpdsF47011? And lpdsF4201?

    I'm assuming you already have the lpdsF4201 structure populated and that you're trying load lpdsF47011.

    I would think you'd probably want to try something like the following:
    F47011 dsF47011 = {0};

    Then your API call for the F47011 line would like the following:
    (LPVOID)&dsF47011,

    If you defined lpdsF47011 as: LPF47011 lpdsF47011 = NULL; (or similar... as a pointer instead of a structure), then you would need to allocate memory for that pointer before you can reference it in the API call. Without doing so would cause a memory violation.
    Jeremy
    E1 Consultant
    Minneapolis, MN

  4. #4
    Senior Member
    Join Date
    Mar 2004
    Location
    Fort Worth, Texas
    Posts
    1,517
    I have used these quite a bit. JDEDM_LoadDSfromDS is for loading from a BSFN DS and if memory serves, I don't think it will work with tables (as you found out). I don't think there is one for table to table data structs oddly enough.
    Brian Oster
    Application Development Manager
    E1: 9.0 (TR9.1.5.1) / 9.2 (TR9.2.2.2)
    JAS/BSSV: Weblogic 12.1.2 / Weblogic 12.2
    ES: Win2008 / Win2016
    DB: MSSQL 2014 / 2016
    WebDev Client: Win7Pro / Win10Pro

  5. #5
    Thank guys.
    @JMR - I'm allocating memory in pretty much that way.

    From my testing, the clue is in the name. A JDE data structure is required when it is mentioned in the API.

    I've ended up using the 2 api's below and created 2 new DS's to match F47011/F47012 (copied from D4202034/40 and enhanced).

    JDEDM_LoadDSfromTableRecord
    JDEDM_LoadTableRecordfromDS

  6. #6
    Ball's. I replied to this thread but it's disappeared.

    Ended up using the 2 API's below. Had to create 2 custom DS's to be the middle man.

    JDEDM_LoadDSfromTableRecord
    JDEDM_LoadTableRecordfromDS

  7. #7
    Member craig_welton's Avatar
    Join Date
    Oct 2000
    Location
    Litchfield, CT
    Posts
    961
    We have done something generic using JDBRS_GetTableSpecsFromHandle on the source and destination tables. You can examine each of the columns in the tablecache structure of each handle. If they exist in both tables, the data can be copied to the destination using JDB_GetTableColValue and JDB_AssignColumnValue.

    Craig
    Craig Welton
    PatWel Group Inc.
    http://www.patwel.com
    Home of the FREE JDE Object Browser, JDETrace and NERDup Tools

    E1 9.0 8.98.4.2 Wintel SQL 2008
    E1 9.2 9.2.1.4 iSeries

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.